Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Cynwell opened this issue Jan 8, 2024 · 3 comments · Fixed by #254
Closed

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

Cynwell opened this issue Jan 8, 2024 · 3 comments · Fixed by #254
Labels
enhancement New feature or request

Comments

@Cynwell
Copy link

Cynwell commented Jan 8, 2024

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

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛 [Bug]:

@Cynwell Cynwell changed the title 🐛 [Bug]: 🐛 [Bug]: 应该在生产配置里使用 *.prod.js, 而不是 *.js Jan 8, 2024
@chilingling chilingling added the enhancement New feature or request label Jan 11, 2024
@chilingling
Copy link
Member

@rhlin 可以认领一下

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


@rhlin can claim it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants