ERROR in multi vendor Module not found: Error: Cannot resolve module 'antd-mobile'
See original GitHub issue本地环境
- antd-mobile 版本:0.9.9
- 操作系统及其版本:mac
- 浏览器及其版本:chrome
你做了什么?
设置了分离打包 (不分离打包可以运行,但是build 又提示找不到组件了。)
entry: {
app: path.join(src, 'app.js'),
vendor: [
'antd-mobile',
'react',
'react-dom',
'react-redux',
'react-router',
'react-router-redux',
'redux',
'redux-saga',
'whatwg-fetch'
]
}
bulid 报错提示 ReferenceError: ActivityIndicator is not defined
实际有引入 import { ActivityIndicator } from 'antd-mobile';
安装了按需加载 babel-plugin-import
["import", { "style": "css", "libraryName": "antd-mobile" }]
你期待的结果是:
像官网一样正常显示
实际上的结果:
可重现的在线演示
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Error: Cannot resolve module 'react-router' in /path-to-project ...
Those errors mean that you haven't installed the corresponding modules. Run npm install --save alt react-router .
Read more >How to fix 'Module not found: Can't resolve 'http' in ... - YouTube
Basically, just change 'react-scripts' to 4.0.2 in your package.json and run `npm install` again :D Follow me on Twitter: ...
Read more >Module not found: Error: Can't resolve '@mui/material/Search ...
I'm on Debian 11 with npm 8.16, node 16.16 and installed Material-ui with npm install @mui/material @emotion/react @emotion/styled.
Read more >antd-mobile - npm
Start using antd-mobile in your project by running `npm i antd-mobile`. There are 601 other projects in the npm registry using antd-mobile.
Read more >Index of npm-remote-cache/.npm - maven.forgerock.org
apollo-server-errors/. 13-07-20 06:03:47 -0700 ... babel-plugin-transform-es2015-modules-amd/ ... ignore-not-found-export-webpack-plugin/.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
antd-mobile 放到 vendor 里不太好,不要一次全部引入
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.