I have an app with this folder structure :
src
├── App
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── index.js
│ └── logo.svg
├── index.css
├── index.js
Inside the index.js file, I have this line :import App from './App
Which causes this error :
Failed to compile.
Error in ./src/index.js
Module not found: [CaseSensitivePathsPlugin] `/home/benoit/Development/react-spring-template/client/src/App.js` does not match the corresponding path on disk - File does not exist.
When I add a /
at the end of the path, then it works.import App from './App
Is there a reason why the folder import doesn't work without a trailing slash, or is this a bug ?
Expected behaviorI should be able to import something from the index.js
file of a subfolder without putting a trailing slash at the end of the folder.
I need to put a trailing slash at the end of the import
statement if it's a folder.
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected):npm ls react-scripts
client@0.1.0 /home/benoit/Development/react-spring-template/client
└── react-scripts@0.8.1
node -v
:v7.2.0
npm -v
:4.0.2
Then, specify:
reergymerej, sundy001 and Kushagra8888
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4