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

微信小程序独立分包报错 #17275

Open
felix9ia opened this issue Feb 6, 2025 · 5 comments
Open

微信小程序独立分包报错 #17275

felix9ia opened this issue Feb 6, 2025 · 5 comments

Comments

@felix9ia
Copy link

felix9ia commented Feb 6, 2025

相关平台

微信小程序

小程序基础库: 3.7.3
使用框架: React

复现步骤

    {
      root: "pages/subScan",
      pages: [
        "pages/pay/index"
      ],
      independent: true
    },

期望结果

能正常运行

实际结果

Image

Image

Image

开启独立分包 independent: true 就报错,在调试器里报错,不开启不报错

[system] WeChatLib: 3.6.6 (2025.1.17 11:53:02)
[system] No. of subpackages: 3
[system] LazyCodeLoading: false
页面【subScan/comp]错误:
 TypeError: n[e] is not a function
    at __webpack_require__ (runtime.js:2)
    at Object../node_modules/@tarojs/webpack5-runner/dist/template/comp.js (comp.js:3)
    at __webpack_require__ (runtime.js:2)
    at comp.js:3
    at Function.__webpack_require__.O (runtime.js:2)
    at comp.js:3
    at webpackJsonpCallback (runtime.js:2)
    at comp.js:3
    at WASubContext.js?t=wechat&s=1738822919980&v=3.6.6:1
    at _.runWith (WASubContext.js?t=wechat&s=1738822919980&v=3.6.6:1)(env: Windows,mp,1.06.2409140; lib: 3.6.6)
TypeError: n[e] is not a function
    at __webpack_require__ (runtime.js:2)
    at Object../node_modules/@tarojs/webpack5-runner/dist/template/comp.js (comp.js:3)
    at __webpack_require__ (runtime.js:2)
    at comp.js:3
    at Function.__webpack_require__.O (runtime.js:2)
    at comp.js:3
    at webpackJsonpCallback (runtime.js:2)
    at comp.js:3
    at WASubContext.js?t=wechat&s=1738822919980&v=3.6.6:1
    at _.runWith (WASubContext.js?t=wechat&s=1738822919980&v=3.6.6:1)(env: Windows,mp,1.06.2409140; lib: 3.6.6)
Component is not found in path "wx://not-found".(env: Windows,mp,1.06.2409140; lib: 3.6.6)
Page "subScan/pages/pay/index" has not been registered yet.

环境信息

👽 Taro v4.0.9


  Taro CLI 4.0.9 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 18.17.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
      npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 4.0.9 => 4.0.9 
      @tarojs/components: 4.0.9 => 4.0.9 
      @tarojs/helper: 4.0.9 => 4.0.9 
      @tarojs/plugin-framework-react: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-alipay: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-h5: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-harmony-hybrid: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-jd: 4.0.9 => 4.0.9 
      @tarojs/plugin-platform-qq: 4.0.9 => 4.0.9
      @tarojs/plugin-platform-swan: 4.0.9 => 4.0.9
      @tarojs/plugin-platform-tt: 4.0.9 => 4.0.9
      @tarojs/plugin-platform-weapp: 4.0.9 => 4.0.9
      @tarojs/react: 4.0.9 => 4.0.9
      @tarojs/runtime: 4.0.9 => 4.0.9
      @tarojs/shared: 4.0.9 => 4.0.9
      @tarojs/taro: 4.0.9 => 4.0.9
      @tarojs/taro-loader: 4.0.9 => 4.0.9
      @tarojs/webpack5-runner: 4.0.9 => 4.0.9
      babel-preset-taro: 4.0.9 => 4.0.9
      eslint-config-taro: 4.0.9 => 4.0.9
      react: ^18.2.0 => 18.3.1


This was referenced Feb 8, 2025
@xuemian168
Copy link

遇到同样问题
Page "pages/search/index" has not been registered yet.

@ryan-vn
Copy link

ryan-vn commented Mar 13, 2025

现在taro还在维护吗? 这个问题大家有解决方案了吗?

@felix9ia
Copy link
Author

@Chen-jj 看来大家都遇到了独立分包报错的问题,希望帮指派一个人跟踪一下这个问题。谢谢我尝试升级到了 4.0.9 都没能解决。

@felix9ia
Copy link
Author

@Chen-jj 看来大家都遇到了独立分包报错的问题,希望帮指派一个人跟踪一下这个问题。谢谢我尝试升级到了 4.0.9 都没能解决。

@luckyadam

@list99197
Copy link

或许试试config/index里的mini加个配置,修改下jsonpFunction变量名
webpackChain(chain) {
chain.merge({
output: {
jsonpFunction: process.env.JSONP_NAME || "webpackJsonpAlias"
}
})
}

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

4 participants