question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
warmhugcommented, Dec 1, 2016

antd-mobile 放到 vendor 里不太好,不要一次全部引入

0reactions
lock[bot]commented, May 28, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found