webpack: file does not match the corresponding path on disk - File does not exist

I’m reporting a bug.

What is the current behavior?

When I change files (recompiled in a linked package), webpack chokes with

Error in ./src/index.js
Module not found: [CaseSensitivePathsPlugin] `some file.js` does not match the corresponding path on disk - File does not exist.

 @ ./src/index.js 29:16-36

What is the expected behavior?

I’d expect webpack to just happily restart.

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

I’m using webpack 1.13.2 and server 1.16.1.

I filed this issue with the app I’m working on at https://github.com/vega/vega-editor/issues/129.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 39 (2 by maintainers)

Most upvoted comments

I am having the same issue with React. I created an app using create-react-app, and am not using webpack to compile. I have tried renaming the React node package, deleting it, reinstalling it, and the same error continues. Therefore, maybe it isn’t a webpack issue? Using node v8.9.1, React v16.2.0

EDIT: This was an error of mine, and I believe that I was trying to use the statement import React from "React" instead import React from "react". Also, it may have been an issue that I added react using npm instead of yarn.

npm install --save-dev case-sensitive-paths-webpack-plugin

It should do the trick

File an issue for the CaseSensitivePathsPlugin.

I just renamed the folder and it worked. Thanks 😃

I had the same issue. It was because I used small case in folder name in my import statement. When in fact it should have been upper case. Replaced "import Layout from ‘./component/MainLayout’; to "import Layout from ‘./Component/MainLayout’; worked for me.

Problem related to CaseSensitivePathsPlugin. Close in favor https://github.com/Urthen/case-sensitive-paths-webpack-plugin/issues/22

is there a fix for this issue that domoritz is referring to?

It is may not be a webpack issue, did you try restarting webpack-dev-server? if yes is it woking after that?

./src/Pages/PlayQuiz.js Module not found: C:\Users\abc\project\client\src\Components\Comments.js does not match the corresponding path on disk components.

@Farbod29 I got the same error on my project when I run.

anyone help or suggest something what shall I do?

check the pass of remote and your local system be same if you have capital S in Src path change it to small. Error in ./src/index.js

Hallo, any hints how I can solve this issue with localhost? I cannot open my react app thanks

Failed to compile ./src/index.js Cannot find file: ‘index.js’ does not match the corresponding name on disk: ‘./node_modules/React/react’.

https://stackoverflow.com/questions/55149843/error-cannot-find-file-index-js-does-not-match-the-corresponding-name-on-dis fixed the problem with my build. Basically it’s: import React from "react" and not import React from "React"

If you use cygwin, change to your project folder without using ~. It works for me.

@irenapopova in your webpack config file are you using externals? I had the same issue and noticed I had:

externals: {
    react: 'React',
    'react-dom': 'ReactDOM',
  },

because my target library is commonjs2 I needed to change it to the following:

externals: {
    react: 'react',
    'react-dom': 'react-dom',
  },

if your using multiple targets you should refer to Webpack Externals

File an issue for the CaseSensitivePathsPlugin.

This mostly an issue with CaseSensitivePathsPlugin. Be sure your file name is capital case instead of small case. if you import MyComponent from "../components/MyComponent" be sure your file name is MyComponent in not myComponent or vice versa

What worked for me as to Restart npm start and there move the file missing out of the folder and back, then it compiled fine.

npm install --save-dev case-sensitive-paths-webpack-plugin

It should do the trick

This worked for me. Thanks.