最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

React Module Not Found: Unable to Resolve 'App' - Stack Overflow

programmeradmin0浏览0评论

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 badge
Add a comment  | 

1 Answer 1

Reset to default 0

The 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.

发布评论

评论列表(0)

  1. 暂无评论