相关平台
字节跳动小程序
小程序基础库: 3.11.0
使用框架: Vue 3
复现步骤
1、npm run dev:tt
2、抖音开发工具加载编译后的小程序代码
3、提示错误:
[TMA] {message: "Can't find module ./prebundle/vendors-node_modules…undle_nutui_nutui-taro_js.ttss imported by app.js", name: "USER_GLOBAL_ERROR", stack: "at ?(USER_RESOLVE_MODULE_ERROR: Can't find module …://127.0.0.1:7045/app-dist/app-service.js:139:2)↵"}
期望结果
头条小程序开发工具加载编译代码目录不出现异常错误。
实际结果
小程序开发工具编译代码异常
环境信息
Taro CLI 3.6.19 environment info:
System:
OS: macOS 12.7.2
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 20.11.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.4 - /usr/local/bin/npm
npmPackages:
@tarojs/cli: 3.6.19 => 3.6.19
@tarojs/components: 3.6.19 => 3.6.19
@tarojs/helper: 3.6.19 => 3.6.19
@tarojs/plugin-framework-vue3: 3.6.19 => 3.6.19
@tarojs/plugin-html: ^3.6.23 => 3.6.23
@tarojs/plugin-platform-alipay: 3.6.19 => 3.6.19
@tarojs/plugin-platform-h5: 3.6.19 => 3.6.19
@tarojs/plugin-platform-jd: 3.6.19 => 3.6.19
@tarojs/plugin-platform-qq: 3.6.19 => 3.6.19
@tarojs/plugin-platform-swan: 3.6.19 => 3.6.19
@tarojs/plugin-platform-tt: 3.6.19 => 3.6.19
@tarojs/plugin-platform-weapp: 3.6.19 => 3.6.19
@tarojs/plugin-vue-devtools: ^3.6.21 => 3.6.21
@tarojs/runtime: 3.6.19 => 3.6.19
@tarojs/shared: 3.6.19 => 3.6.19
@tarojs/taro: 3.6.19 => 3.6.19
@tarojs/taro-loader: 3.6.19 => 3.6.19
@tarojs/webpack5-runner: 3.6.19 => 3.6.19
babel-preset-taro: 3.6.19 => 3.6.19
eslint-config-taro: 3.6.19 => 3.6.19
6条答案
按热度按时间wpx232ag1#
错误信息
bpsygsoo2#
npm run dev:tt 过程正常,没有错误
xt0899hw3#
app.js
3bygqnnd4#
prebundle 配置 exclude 掉 nutui 试试,或者直接关闭 prebundle
omtl5h9j5#
@Chen-jj dev prebundle默认开启的,设置false 后小程序编译加载代码正常了。然后又还原prebundle:true, 小程序编译加载也正常了
反复试几次 错误又出来了。不稳定
b1uwtaje6#
@Chen-jj dev prebundle默认开启的,设置false 后小程序编译加载代码正常了。然后又还原prebundle:true, 小程序编译加载也正常了 反复试几次 错误又出来了。不稳定
参考:jdf2e/nutui#2461 (comment)
关闭 prebundle 或者将第三方组件库排除在外,是必要的配置。