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

h5打包移除懒加载后打包报错 #16933

Open
ymz-0310 opened this issue Nov 27, 2024 · 0 comments
Open

h5打包移除懒加载后打包报错 #16933

ymz-0310 opened this issue Nov 27, 2024 · 0 comments

Comments

@ymz-0310
Copy link

ymz-0310 commented Nov 27, 2024

相关平台

H5

浏览器版本: Chrome 131.0.6778.86
使用框架: React

复现步骤

根据文档https://taro-docs.jd.com/blog/2022-01-20-Taro-3.4#3-dynamic-import-node ,在taro项目中的babel.config.js增加如下配置后打包
presets: [
[
'taro',
{
framework: 'react',
ts: true,
hot: false,
'dynamic-import-node': true,
},
],
],

期望结果

h5正常移除懒加载打包不报错

实际结果

打包后报如下错
hook.js:608 Error: Cannot find module './taro-view-core.entry.js'
at webpackEmptyContext (eval at ./node_modules/@tarojs/components/dist/esm-es5 sync recursive (app.6bd2a42….js:4915:1), :2:10)
at eval (index-5bd7cbab.js:1482:1) undefined
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'isProxied')
at eval (index-5bd7cbab.js:1248:1)
at i (index-5bd7cbab.js:125:1)
at Object.eval [as next] (index-5bd7cbab.js:74:1)
at s (index-5bd7cbab.js:33:1)

环境信息

Taro CLI 3.4.4 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 16.15.1 - D:\tools\nodejs\node.EXE
      Yarn: 1.22.22 - D:\tools\nodejs\node_global\yarn.CMD
      npm: 8.11.0 - D:\tools\nodejs\npm.CMD
This was referenced Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant