Skip to content

🐛 [Bug]: 应该在生产配置里使用 *.prod.js, 而不是 *.js #240

@Cynwell

Description

@Cynwell

Environment

win11, Command Prompt

Version

v20.10.0

Version

`-- (empty)

Link to minimal reproduction

Step to reproduce

我在跟着教程尝试服务器部署方案时遇到两个问题:
(1)代码里没有使用 *.prod.js 对应 production environment
(2)出现错误 __VUE_PROD_DEVTOOLS__ is not defined, 应该是内置插件没有配置好导致的

以下是我在浏览器 console 看见的错误:

You are running a development build of Vue.
Make sure to use the production build (*.prod.js) when deploying for production.

runtime-core.esm-bundler.js:8070  Uncaught ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined
    at runtime-core.esm-bundler.js:8070:63

复现步骤 (~15min):

我看的是官网的教程:
https://opentiny.design/tiny-engine#/help-center/course/backend/51

  • 我把 tiny-engine, tiny-engine-data-center 和 tiny-engine-webservice clone 到同一个 directory 里, e.g.:
    • (root)/tiny-engine
    • (root)/tiny-engine-data-center
    • (root)/tiny-engine-webservice
  • 前面根据教程设置好 tiny-engine, tiny-engine-data-center 和 tiny-engine-webservice, 并使用了 pnpm serve:frontend 运行 tiny-engine 的前端,可以正常启动及显示,没有错误
  • 服务部署:前端资源打包 (✅)
    • (root)/tiny-engine 里,我使用了 pnpm run build:plugin && pnpm run build:prod 来完成 (官网教程漏了 pnpm run build:plugin
  • Web Service 整改 第一步:存放静态资源, 第二步:安装并配置渲染引擎, 第三步:配置路由 (✅)
    • (root)/tiny-engine-webservice 里,我使用了 del /q app\public\* app\view\* && xcopy ..\tiny-engine\packages\design-core\dist\ app\public\ /s /e /Y && move app\public\*.html app\view\ 来完成第一步
    • 第二步和第三步都根据指示修改文件了
  • 完成后运行 pnpm run dev, 然后访问 http://localhost:7011/entry?id=918&type=app, 出现上述错误

What is expected

预期浏览器 console 没有出现以下信息和错误:

You are running a development build of Vue.
Make sure to use the production build (*.prod.js) when deploying for production.

runtime-core.esm-bundler.js:8070  Uncaught ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined
    at runtime-core.esm-bundler.js:8070:63

What is actually happening

No response

Any additional comments (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions