admin管理员组文章数量:1306276
As a newcomer to the industry, I just want to share my experience today. I encountered a compilation issue when I create a new react app (react 18). During the build process, I ran into the following error:
ERROR in ./src/index.tsx 7:0-24
Module not found: Error: Can't resolve './App' in '/Users/xianjunyang/Documents/test_app/menubar-test-app/src'
Despite multiple troubleshooting attempts, the issue persisted. I explored various solutions, including verifying file paths, checking module imports, and reinstalling dependencies, but none resolved the problem.
As a newcomer to the industry, I just want to share my experience today. I encountered a compilation issue when I create a new react app (react 18). During the build process, I ran into the following error:
ERROR in ./src/index.tsx 7:0-24
Module not found: Error: Can't resolve './App' in '/Users/xianjunyang/Documents/test_app/menubar-test-app/src'
Despite multiple troubleshooting attempts, the issue persisted. I explored various solutions, including verifying file paths, checking module imports, and reinstalling dependencies, but none resolved the problem.
Share Improve this question edited Feb 3 at 13:34 yang yang asked Feb 3 at 13:33 yang yangyang yang 11 bronze badge1 Answer
Reset to default 0The issue is that I am using macOS.
On macOS, which uses a case-sensitive file system, the import statement must exactly match the filename:
import App from './App.tsx';
in windows, we can:
import App from './App';
The solution is to explicitly include the file extension in the import statement on macOS.
本文标签: React Module Not Found Unable to Resolve 39App39Stack Overflow
版权声明:本文标题:React Module Not Found: Unable to Resolve 'App' - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741818119a2399197.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论