Error: undefined Unable to resolve module antd-mobile/dist/antd-mobile.less from D:\LinkSpace\Work\WorkSpace\Code\WebStorm\ReactPro\USDTWalletApp\App.js: antd-mobile/dist/antd-mobile.less could not be found within the project or in these directories: node_modules #1166
Start error
[Error: undefined Unable to resolve module antd-mobile/dist/antd-mobile.less from D:\LinkSpace\Work\WorkSpace\Code\WebStorm\ReactPro\USDTWalletApp\App.js: antd-mobile/dist/antd-mobile.less could not be found within the project or in these directories:
node_modules
If you are sure the module exists, try these steps:
Clear watchman watches: watchman watch-del-all
Delete node_modules and run yarn install
Reset Metro's cache: yarn start --reset-cache
Remove the cache: rm -rf /tmp/metro-*
27 | } from 'react-native/Libraries/NewAppScreen';
28 | import Login from './src/component/login';
ERROR [Error: undefined Unable to resolve module antd-mobile/dist/antd-mobile.less from D:\LinkSpace\Work\WorkSpace\Code\WebStorm\ReactPro\USDTWalletApp\App.js: antd-mobile/dist/antd-mobile.less could not be found within the project or in these directories:
node_modules
If you are sure the module exists, try these steps:
1. Clear watchman watches: watchman watch-del-all
2. Delete node_modules and run yarn install
3. Reset Metro's cache: yarn start --reset-cache
4. Remove the cache: rm -rf /tmp/metro-*
27 | } from 'react-native/Libraries/NewAppScreen';
28 | import Login from './src/component/login';
> 29 | import 'antd-mobile/dist/antd-mobile.less';
| ^
30 |
31 | const Section = ({children, title}): Node => {
32 | const isDarkMode = useColorScheme() === 'dark';]
Reproduction link
https://u.ant.design/codesandbox-repro
Steps to reproduce
npx react-native init AwesomeProject
Command creates the project$ npm install antd-mobile --save
Command adds a UI componentimport 'antd-mobile/dist/antd-mobile.css';
config plugin
Start error [Error: undefined Unable to resolve module antd-mobile/dist/antd-mobile.less from D:\LinkSpace\Work\WorkSpace\Code\WebStorm\ReactPro\USDTWalletApp\App.js: antd-mobile/dist/antd-mobile.less could not be found within the project or in these directories: node_modules
If you are sure the module exists, try these steps:
What is expected?
Normal display style
What is actually happening?
The project structure is as follows![image](https://user-images.githubusercontent.com/27654200/111936977-c61dc500-8b01-11eb-841f-d64131ec449d.png)