taro
taro copied to clipboard
Taro 4.0.7 初始化社区vite vue3 nutui模版报错 WXMLRT_$gwx:./base.wxml:template:14:18: Template `tmpl_0_14` not found.
相关平台
微信小程序
小程序基础库: 3.6.6 使用框架: Vue 3
复现步骤
初始化社区模版,运行小程序报错,删除nutui后,回归正常
期望结果
正常运行
实际结果
WXMLRT_$gwx:./base.wxml:template:14:18: Template tmpl_0_14 not found.
环境信息
👽 Taro v4.0.7
(node:32265) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Taro CLI 4.0.7 environment info:
System:
OS: macOS 15.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.1.0 - ~/.nvm/versions/node/v21.1.0/bin/node
npm: 10.8.1 - ~/.nvm/versions/node/v21.1.0/bin/npm
npmPackages:
@tarojs/cli: 4.0.7 => 4.0.7
@tarojs/components: 4.0.7 => 4.0.7
@tarojs/helper: 4.0.7 => 4.0.7
@tarojs/plugin-framework-vue3: 4.0.7 => 4.0.7
@tarojs/plugin-html: 4.0.7 => 4.0.7
@tarojs/plugin-platform-h5: 4.0.7 => 4.0.7
@tarojs/plugin-platform-weapp: 4.0.7 => 4.0.7
@tarojs/runtime: 4.0.7 => 4.0.7
@tarojs/shared: 4.0.7 => 4.0.7
@tarojs/taro: 4.0.7 => 4.0.7
@tarojs/vite-runner: 4.0.7 => 4.0.7
babel-preset-taro: 4.0.7 => 4.0.7
eslint-config-taro: 4.0.7 => 4.0.7
升级到4.0.8
WXML Runtime warning] ./base.wxml
Template tmpl_0_75 not found.
taro 4.0.9 nutui4.3.13 加上nutui的组件就会有这个
我也是这个问题,改了这个也不行。
// config/index.js
config = {
compiler: {
type: 'vite',
prebundle: {
exclude: ['@nutui/nutui-react-taro', '@nutui/icons-react-taro']
}
},
cache: {
enable: false
}
}
感觉进入死胡同了,走不下去
taro + vite4.x + nutui,在页面里使用nutui的组件,运行后,微信开发者工具端就会出现WXMLRT_$gwx:./base.wxml:template:84:18: Template tmpl_0_14 not found.的警告,nutui的组件无法显示。
改成webpack5就可以正常显示
taro info
👽 Taro v4.0.8
Taro CLI 4.0.8 environment info:
System:
OS: macOS 15.0
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v20.9.0/bin/yarn
npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
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-html: 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-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/vite-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.0.0 => 18.3.1
package.json
{
"name": "xxx",
"version": "1.0.0",
"private": true,
"description": "xxx",
"type": "module",
"templateInfo": {
"name": "react-NutUI",
"typescript": true,
"css": "Less",
"framework": "React"
},
"scripts": {
"postinstall": "weapp-tw patch",
"build:weapp": "taro build --type weapp --mode api.prod",
"build:weapp:dev": "taro build --type weapp --mode api.dev",
"build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
"build:h5": "taro build --type h5",
"build:rn": "taro build --type rn",
"build:qq": "taro build --type qq",
"build:jd": "taro build --type jd",
"build:quickapp": "taro build --type quickapp",
"predev:weapp": "node scripts/miniprogram.mjs",
"dev:weapp": "npm run build:weapp -- --watch --mode api.dev",
"predev:weapp:prod": "node scripts/miniprogram.mjs",
"dev:weapp:prod": "npm run build:weapp -- --watch --mode api.prod",
"dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"dev:rn": "npm run build:rn -- --watch",
"dev:qq": "npm run build:qq -- --watch",
"dev:jd": "npm run build:jd -- --watch",
"dev:quickapp": "npm run build:quickapp -- --watch"
},
"browserslist": [
"last 3 versions",
"Android >= 4.1",
"ios >= 8",
"defaults and fully supports es6-module"
],
"author": "",
"dependencies": {
"@babel/runtime": "^7.21.5",
"@nutui/nutui-react-taro": "^2.6.14",
"@tarojs/components": "4.0.9",
"@tarojs/helper": "4.0.9",
"@tarojs/plugin-framework-react": "4.0.9",
"@tarojs/plugin-html": "4.0.9",
"@tarojs/plugin-platform-alipay": "4.0.9",
"@tarojs/plugin-platform-h5": "4.0.9",
"@tarojs/plugin-platform-jd": "4.0.9",
"@tarojs/plugin-platform-qq": "4.0.9",
"@tarojs/plugin-platform-swan": "4.0.9",
"@tarojs/plugin-platform-tt": "4.0.9",
"@tarojs/plugin-platform-weapp": "4.0.9",
"@tarojs/react": "4.0.9",
"@tarojs/runtime": "4.0.9",
"@tarojs/shared": "4.0.9",
"@tarojs/taro": "4.0.9",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@babel/core": "^7.8.0",
"@babel/plugin-proposal-class-properties": "7.14.5",
"@babel/preset-react": "^7.26.3",
"@tailwindcss/postcss": "^4.0.9",
"@tailwindcss/vite": "^4.0.9",
"@tarojs/binding-darwin-arm64": "^4.0.9",
"@tarojs/cli": "4.0.9",
"@tarojs/test-utils-react": "^0.1.1",
"@tarojs/vite-runner": "4.0.9",
"@types/react": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"@vitejs/plugin-react": "^4.1.0",
"babel-plugin-import": "^1.13.8",
"babel-preset-taro": "4.0.9",
"chalk": "^5.4.1",
"enquirer": "^2.4.1",
"eslint": "^8.12.0",
"eslint-config-taro": "4.0.9",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-react-hooks": "^4.2.0",
"less": "^4.1.3",
"miniprogram-automator": "^0.12.1",
"postcss": "^8.5.3",
"react-refresh": "^0.11.0",
"stylelint": "^14.4.0",
"tailwindcss": "^4.0.9",
"terser": "^5.16.8",
"typescript": "^5.1.0",
"vite": "^4.2.0",
"vite-plugin-imp": "^2.4.0",
"weapp-tailwindcss": "^4.0.10"
},
"pnpm": {
"onlyBuiltDependencies": [
"weapp-tailwindcss"
]
}
}
vite + 4.0.9 + react 也是一样问题
其实vite 对于小程序开发的效率几乎为零增长 , 我目前用vite 刷新一次 6秒+ 还是没有业务的情况下 必后端编译一次的时间还长
最新的版本, vite仍然报错, 换成webpack的脚手架正常. 选择的vue3, webpack, nutui 的脚手架, package.json内的webpack版本有问题, "webpack": "5.78.0" 需要改成 "webpack": "5.91.0"
目前还是存在问题,推荐webpage还是vite搭建啊
WXMLRT_$gwx:./base.wxml:template:90:18: Template tmpl_0_14 not found.
[WXML Runtime warning] ./base.wxml
Template tmpl_0_14 not found.
88 |
89 |
90 | | ^ 91 | 92 | 93 |
taro info
👽 Taro v4.0.9
Taro CLI 4.0.9 environment info:
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 22.14.0 - D:\0.Software\nodejs\node.EXE
npm: 11.2.0 - D:\0.Software\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-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.0.0 => 18.3.1
taro-ui: ^3.3.0 => 3.3.0
vite报错,webpack打包脚手架示例代码中Toast无法正常显示文字
你们的开发人员是不是都不测试就发布了? 为什么这种问题在vite上出现? 每个可选项你提供选择,就务必保证它能流畅运行,好嘛????
怎么样了 今天 用 cli 生成新项目还是有这个问题还没解决
同样是这个问题...有什么解决办法么。每个版本用模板初始化都有新问题出现...
taro4.1.5+vite4.2+nutui2.6。 一样问题 真不明白 官方模版都跑不了 而且这种P0级别bug还存在将近1年,还好意思发布出来让人用taro?
taro4.1.5+vite4.2+nutui2.6。 一样问题 真不明白 官方模版都跑不了 而且这种P0级别bug还存在将近1年,还好意思发布出来让人用taro?
更换vite为webpack,可以正常使用,我自己使用过程中,跑通了微信小程序的构建,暂时没发现其他问题。虽然文档什么的过期了很多,但是勉强能靠猜猜出应该怎么用。
另外,根据这个代码库近期的提交来看,这个项目已经事实性死亡了,很多严重的问题被反复提及但无人修复,有的问题社区的热心开发者修复了也没合并。文档也过时了不是一星半点儿。
公司的开源项目就这点最令人惋惜,应该是原班人马被抽调去干别的去了,留下的开发人员无力管理这么大的一个工程了。属实遗憾
vite 4.2.0
官方react模板
2025.09.19 我的taro+vue3+vite+nutui也是这个问题。 当前taro版本4.1.5,nutui: ^4.2.8,真的是绝了,哈哈
4.1.7 照旧
另外 pnpm audit --json 有报严重漏洞 vite版本 "vulnerabilities": { "info": 0, "low": 2, "moderate": 5, "high": 3, "critical": 0 },
webpack 版本 "vulnerabilities": { "info": 0, "low": 0, "moderate": 7, "high": 3, "critical": 2 },
2025/11/11