-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
h5执行打包操作报错 #16314
Comments
taro-bot2
bot
added
F-react
Framework - React
T-h5
Target - 编译到 H5
V-3
Version - 3.x
labels
Aug 15, 2024
同样的问题 |
This was referenced Aug 17, 2024
在linux下试了下 可以成功打包, 初步判断应该是windows路径的问题 |
This was referenced Aug 17, 2024
迁移到webpack正常,vite不行 |
目前只能使用linux打包 |
请问如何迁移到webpack |
我也遇到这个问题,官方能不能快点解决一下啊 |
坑好多,各种各样的问题 |
我试了,提示一样的报错信息,windows电脑,我重新 Taro init 一个是webpack的项目,h5打包没问题了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关平台
H5
复现仓库
https://gitee.com/yamlling_admin/taro-react-taroui.git
浏览器版本: edge127.0.2651.98
使用框架: React
复现步骤
npm run build:h5
期望结果
打包成功
实际结果
vite v4.5.3 building for production...
✓ 3 modules transformed.
✓ built in 72ms
[vite]: Rollup failed to resolve import "\app.config.ts" from "C:/Users/Notx200/Desktop/react-app/src/index.html".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
file:///C:/Users/Notx200/Desktop/react-app/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:48216
throw new Error(
[vite]: Rollup failed to resolve import "${exporter}" from "${id}".\n
^
Error: [vite]: Rollup failed to resolve import "\app.config.ts" from "C:/Users/Notx200/Desktop/react-app/src/index.html".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
at viteWarn (file:///C:/Users/Notx200/Desktop/react-app/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:48216:27)
at onwarn (C:\Users\Notx200\Desktop\react-app\node_modules@vitejs\plugin-react\dist\index.cjs:274:9)
at onRollupWarning (file:///C:/Users/Notx200/Desktop/react-app/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:48245:9)
at onwarn (file:///C:/Users/Notx200/Desktop/react-app/node_modules/vite/dist/node/chunks/dep-41cf5ffd.js:47976:13)
at file:///C:/Users/Notx200/Desktop/react-app/node_modules/rollup/dist/es/shared/node-entry.js:24276:13
at Object.logger [as onLog] (file:///C:/Users/Notx200/Desktop/react-app/node_modules/rollup/dist/es/shared/node-entry.js:25950:9)
at ModuleLoader.handleInvalidResolvedId (file:///C:/Users/Notx200/Desktop/react-app/node_modules/rollup/dist/es/shared/node-entry.js:24862:26)
at file:///C:/Users/Notx200/Desktop/react-app/node_modules/rollup/dist/es/shared/node-entry.js:24822:26 {
watchFiles: [
'taro:compiler',
'C:\Users\Notx200\Desktop\react-app\src\pages\index\index.config.ts',
'C:\Users\Notx200\Desktop\react-app\src\pages\car\index.config.ts',
'C:/Users/Notx200/Desktop/react-app/src/index.html',
'\x00vite/modulepreload-polyfill'
]
}
Node.js v18.20.4
环境信息
The text was updated successfully, but these errors were encountered: