-
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
3.6.24开始一直到最新的3.6.26我的库一直编译失败,看报错像是jsx不支持了? #15515
Comments
+1, 现在锁定3.6.24了 |
有解决办法吗 |
分别在 mini、h5 节点中加了
|
参考这个评论 #15480 (comment) ,应该是同一个问题。 针对题主的项目,出错的只是 example 子项目,不影响 lib 的编译。 出错的代码位于 import componentsDoc from 'components-doc'; const alias = {
lodash: '@kne/lodash-wechat',
'components-doc': require.resolve('../components-doc.js')
}; 对应的修复: const path = require('node:path');
const config = {
// ...
mini: {
// ...
compile: {
include: [path.resolve(__dirname, '../components-doc.js')],
},
},
h5: {
// ...
compile: {
include: [path.resolve(__dirname, '../components-doc.js')],
},
},
}; 最后提问题最好提供 最小复现项目 ,毕竟别人没时间研究你的项目结构的话,这个问题不就不了了之了。 |
我明白了,出现这个问题的原因应该是之前版本alias也会走Babel编译,新版本Babel不会编译alias里面配置的文件了,或者是因为babel的loader新加了什么目录排除逻辑? |
|
相关平台
微信小程序
复现仓库
https://github.com/kne-union/antd-taro.git
小程序基础库: 2.24.6
使用框架: React
复现步骤
目前项目代码是没有问题的,但是将package.json中有关taro的包版本改到3.6.24及其以上时就会报错
项目启动方法: npm run init && npm run start
期望结果
编译通过
实际结果
编译报错
环境信息
The text was updated successfully, but these errors were encountered: