Urthen / case-sensitive-paths-webpack-plugin

Enforces case sensitive paths in Webpack requires.
MIT License
428 stars 45 forks source link

Error caused by two files with same name with different case and extensions #59

Open anthotsang opened 3 years ago

anthotsang commented 3 years ago
Module not found: Error: [CaseSensitivePathsPlugin] `/[path]/components/screener/screener.jsx` does not match the corresponding path on disk `Screener.jsx`.

This error was caused by having both a screener.json file and a Screener.jsx file. I confirmed this was the case by renaming the json file and having the error go away.

When importing, the JSON file was always imported with its extension whereas the JSX file was imported without (error did not go away even if I explicitly imported with .jsx extension).

Urthen commented 3 years ago

I'll take a look when I get a chance.

In the meantime, what version of the plugin are you on? There's been some internal structure changes lately.

matziol commented 3 years ago

I have same issue, by having register directory and Register.js file in same location: Cannot find file: 'register.js' does not match the corresponding name on disk: './src/pages/Register.js'. Screenshot 2021-06-09 at 17 26 29 In App.js I want to: import { RegisterPage } from './pages/register';. RegisterPage is located under pages/register/index.js I'm using create-react-app with plugin version 2.4.0

anthotsang commented 3 years ago

Sorry, I forgot to respond. I'm using version 2.3.0