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

版本更新后webpack报错 #5452

Closed
wwb-xigua opened this issue Jul 7, 2022 · 14 comments
Closed

版本更新后webpack报错 #5452

wwb-xigua opened this issue Jul 7, 2022 · 14 comments
Labels

Comments

@wwb-xigua
Copy link

Version of antd-mobile

5.16.1

Operating system and its version

Others

Browser and its version

No response

Sandbox to reproduce

No response

What happened?

升级了版本,从2.3.4->5.16.1,
需求:同时保留了两个版本
方法: "antd-mobile": "^5.16.1",
"antd-mobile-v2": "^2.3.4",

impot {***} from 'antd-mobile'
错误:导入插件的时候找不到lib文件(node-modules)

尝试:手动修改了webpack中
{
libraryName: "antd-mobile",
libraryDirectory: 'es',
style: true
}

第二报错
image

Relevant log output

No response

@wwb-xigua wwb-xigua added the bug label Jul 7, 2022
@IronKinoko
Copy link
Collaborator

@miracles1919
Copy link
Contributor

可以把你的项目打个 zip 发到这里,不然没有办法排查

@wwb-xigua
Copy link
Author

加载-E6加载请看这里https://mobileant.design/zh/guide/import-on demand/#%E%8C%89%9%9C%80%E%A0%E8%BD% BD

我按照文档添加了入口与query,本地运行没有问题,打包的时候出现以上找不到antd-mobile/lib/***

以下是图样
1.webpack
image
2.main.jsx
image
3.组件的使用
image

@IronKinoko
Copy link
Collaborator

你的截图没有看出问题。可以把你的项目打个 zip 发到这里,不然没有办法排查

@wwb-xigua
Copy link
Author

可以把你的项目打个 zip 发到这里,不然没有办法排查

你的截图没有看出问题。可以把你的项目打个 zip 发到这里,不然没有办法排查

项目超过25m
无法使用评论提交

@IronKinoko
Copy link
Collaborator

可以将代码提交到一个新仓库,方便我们 clone

@IronKinoko
Copy link
Collaborator

请提交到github。。。。你这链接还需要登录验证

@wwb-xigua
Copy link
Author

请提交到github。。。。你这链接还需要登录验证

https://github.com/wwb-xigua/--bug.git

@IronKinoko
Copy link
Collaborator

webpack.prod.js 文件里的配置没有修改

@wwb-xigua
Copy link
Author

好的,但是仅仅引用了空组件就会报错
image

image

@bearguo
Copy link

bearguo commented Jul 19, 2022

好的,但是仅仅引用了空组件就会报错 image

image

tabs组件会出现这个问题,我也复现了

@IronKinoko
Copy link
Collaborator

@bearguo 提供一下最小复现代码

@awmleer awmleer added the pending Need more information to continue label Jul 21, 2022
@github-actions
Copy link
Contributor

Hi, wwb-xigua.

It seems that this issue is a bit vague and lacks some necessary information. It is recommended to read How To Ask Questions The Smart Way.

看起来这条 issue 描述得有些模糊,缺少一些必要的信息,推荐阅读一下提问指引

@awmleer
Copy link
Member

awmleer commented Jul 21, 2022

@wwb-xigua 你的问题看起来 @IronKinoko 已经在这里回复了

@bearguo 如果你还遇到了类似的问题,可以考虑单独再提个 issue,并且附上复现 demo

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

No branches or pull requests

5 participants