Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Field组件在h5下面build报错 #685

Open
1 of 7 tasks
bingtsingw opened this issue Sep 19, 2024 · 2 comments
Open
1 of 7 tasks

Field组件在h5下面build报错 #685

bingtsingw opened this issue Sep 19, 2024 · 2 comments

Comments

@bingtsingw
Copy link

bingtsingw commented Sep 19, 2024

这个 Issue 涉及以下平台:

  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 头条小程序
  • 快手小程序
  • QQ 轻应用
  • Web 平台(H5)

BUG 描述
Field组件在h5下面build报错, dev没有任何报错信息

复现步骤
clone 复现repo, https://github.com/bingtsingw/antm-reproduce
node 版本: 16
安装依赖: npx pnpm@8.15.8 install
编译: npm run build
然后用http-server dist/h5开启服务器访问即可复现

期望结果

实际结果

截图
image

环境

附加信息

@bingtsingw
Copy link
Author

bingtsingw commented Sep 19, 2024

不知道和 #682 有没有关系, 我好像部分页面也遇到过undefined, 不过当时是在dev环境下,不影响程序正常运行,所以没有在意

@bingtsingw
Copy link
Author

感谢 子羽 大佬的debug, 是taro生产构建和组件库commonjs的构建有兼容问题, 暂时修复方法: 在config里面加上webpack的alias

alias: {
  '@antmjs/vantui/lib/index.less': path.resolve(__dirname, '../node_modules/@antmjs/vantui/lib/index.less'),
  '@antmjs/vantui': '@antmjs/vantui/es/index',
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant