-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watcher doesn't see a new file called "index.js" inside a subfolder #1164
Comments
Can you consistently reproduce this, after stopping and starting the development server again? |
Oh wow, that was the problem. Sorry about that, I didn't think of that. |
No worries. This is kinda weird—my guess is that it remembers that it couldn't find the file with that exact name, and later gives up searching for it again. Not very good so if you find an easy way to reproduce this step by step (e.g. create a file with some name, then add an import with some form) and it always happens, maybe we should file a bug in one of the upstream projects. Please let me know! |
Ok so i've successfully reproduced, it's very easy in fact.
If I get some more time i'll try to reproduce with webpack-dev-server without react but it may be specific to a particular setting that's use in create-react-app. |
same here, i can reproduce this problem with my own webpack config. |
Yes, it's a Webpack bug. We are keeping the issue open because it affects CRA experience and ideally we'd like to remember to come back to this at some point and figure out a solution. If you'd like to help please let us know! |
Any progress on this issue? |
No, progress doesn’t happen without somebody pushing for it. 😉 I tagged issue as needing contributors. If you’d like to help, you’ll probably need to figure out where this breaks on Webpack side. I don’t know if this is even feasible to fix or not. |
(Just in case you missed it, the workaround is to restart the development server. But it would be nice if this “just worked”.) |
Possibly related to webpack/webpack/issues/1533 |
is this issue really the cause cause for this problem: Any ideas? |
OK, I filed this in webpack: webpack/webpack#6262 We can close this because it's not actionable for us. If it gets fixed upstream we'll get the fix. |
Description
I have an app with this folder structure :
Inside the index.js file, I have this line :
import App from './App
Which causes this error :
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 behavior
I 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.Actual behavior
I need to put a trailing slash at the end of the
import
statement if it's a folder.Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected):node -v
:v7.2.0
npm -v
:4.0.2
Then, specify:
The text was updated successfully, but these errors were encountered: