Urthen / case-sensitive-paths-webpack-plugin

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

"File does not exist" is confusing #19

Closed gaearon closed 7 years ago

gaearon commented 7 years ago

When I switch between branches, I often see messages like this:

Module not found: [CaseSensitivePathsPlugin] /Users/dan/p/create-react-app/packages/react-scripts/template/src/service-worker-registration.js does not match the corresponding path on disk - File does not exist.

Note how it starts with the case sensitive plugin intro, but then the real issue is that the file just stopped existing. So the message is misleading until the very last four words.

Shouldn't the plugin just bail out if a file was deleted, and ignore it? Then webpack can show its normal message about file missing.

Urthen commented 7 years ago

I could probably make the plugin detect when this occurs and completely stop attempting to enforce anything, since presumably your build is about to fail anyway. Would that work?

gaearon commented 7 years ago

Yes, thanks!

gaearon commented 7 years ago

I've also been getting these more often, unfortunately in cases when file does exist. (But didn't exist at some point in the past.)

screen shot 2017-05-21 at 00 56 45

Any chance you could look at this soon? I might try to roll back to an earlier version since I don't think this happened with 1.x.

gaearon commented 7 years ago

I reverted to 1.1.4 which doesn't have this issue (or at least doesn't reproduce as often). In particular, here's what reproduced it for me in 2.0.0:

  1. Import a file that doesn't exist
  2. Create that file

In 1.1.4, it compiles successfully after the file is created, but not in 2.0.0.

Urthen commented 7 years ago

I'm going to try and look at these issues this week. Sorry for taking so long, but I switched jobs and don't actually use this code anymore. I'll try to help out for those who still do though :-)

gaearon commented 7 years ago

No worries 😛 Thanks for still taking a look!

caesarsol commented 7 years ago

I think this may actually be a duplicate of https://github.com/Urthen/case-sensitive-paths-webpack-plugin/issues/17 😄

I guess it could be enough to juste delete the FS caching code, as webpack2 has a special fs module with integrated caching (as far as I understood, please any webpack expert verify this).

I could take a look if @Urthen doesn't find the time!

Urthen commented 7 years ago

I think I have it now, I'm still working on hardening tests. One is still intermittently failing for no good rain.

On Tue, May 30, 2017, 10:36 cesare soldini notifications@github.com wrote:

I think this may actually be a duplicate of #17 https://github.com/Urthen/case-sensitive-paths-webpack-plugin/issues/17 😄

I think it could be enough to juste delete the FS caching code, as webpack2 has a special fs module with integrated caching (as far as I understood, please any webpack expert verify this).

I could take a look if @urthen doesn't find the time!

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Urthen/case-sensitive-paths-webpack-plugin/issues/19#issuecomment-304918280, or mute the thread https://github.com/notifications/unsubscribe-auth/AAb_dqRgNM0LcJFYKgNH63u1B7nbmeJvks5r_DeOgaJpZM4NeRzB .

Urthen commented 7 years ago

Published 2.1.0 which as you mentioned should fix both this and #17. Can you give it a test?

Urthen commented 7 years ago

Scratch that, try with 2.1.1 -- .0 had problems with older versions of node.