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

开发环境无异常,打包后预览,出现空白页 #10991

Closed
Future-came opened this issue May 22, 2024 · 2 comments
Closed

开发环境无异常,打包后预览,出现空白页 #10991

Future-came opened this issue May 22, 2024 · 2 comments

Comments

@Future-came
Copy link

Vue version

3.4.27

Link to minimal reproduction

https://github.com/Future-came/vue3-demo.git

Steps to reproduce

1、rm -rf dist
2、pnpm build
3、pnpm preview
4、打开http://localhost:4173,点击按钮跳转无反应,打开http://localhost:4173/pageA白屏

What is expected?

开发环境正常且打包后,预览时各页面正常。

What is actually happening?

开发环境正常,
但是打包后,进入pageA页面白屏,并且控制台无任何报错。
image

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (40) x64 Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
    Memory: 109.43 GB / 127.89 GB
  Binaries:
    Node: 21.5.0 - ~\AppData\Local\fnm_multishells\18692_1716339535488\node.EXE     
    npm: 10.7.0 - ~\AppData\Local\fnm_multishells\18692_1716339535488\npm.CMD       
    pnpm: 8.15.5 - ~\AppData\Local\fnm_multishells\18692_1716339535488\pnpm.CMD     
  Browsers:
    Edge: Chromium (123.0.2420.97)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    vue: ^3.4.27 => 3.4.27

Any additional comments?

No response

@Math-chen
Copy link

这个和vue没关系,应该是你在vite中加的插件vite-plugin-top-level-await导致的问题,导入所有模块可以使用const modules = import.meta.glob('./dir/*.js', { eager: true })

@Future-came
Copy link
Author

非常感谢,尝试了一下,解决了我的问题。

@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants