本地启动SSR运行项目直接报错:
控制台显示:
23:11:58 [vite] Cannot find module '@dcloudio/uni-app' imported from 'D:/WEB/test-ssr/entry-server.js'
页面显示:Error: Cannot find module '@dcloudio/uni-app' imported from 'D:/WEB/test-ssr/entry-server.js'
at nodeImport (file:///D:/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-79892de8.js:54029:25)
at ssrImport (file:///D:/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-79892de8.js:53950:20)
at eval (D:\WEB\test-ssr\entry-server.js:11:37)
at async instantiateModule (file:///D:/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-79892de8.js:53996:9)
2 个回复
最佳回复
DCloud
HBuilderX 4.01.2024020211-alpha 已修复。
YUANRJ
感谢反馈,后续会修复。
临时解决方案:
替换附件文件到
HBuilderX根目录/plugins/uniapp-cli-vite/node_modules/@dcloudio/uni-h5-vite/dist/utils/
,然后重新运行。