Skip to content
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

Search for index.js in module path #1252

Closed
DmitryOlkhovoi opened this issue Dec 12, 2016 · 3 comments
Closed

Search for index.js in module path #1252

DmitryOlkhovoi opened this issue Dec 12, 2016 · 3 comments

Comments

@DmitryOlkhovoi
Copy link

DmitryOlkhovoi commented Dec 12, 2016

Description

I have component module in App folder, and I have the source file of the module named index.js
I'm trying to import the module like this:
import App from './App

Expected behavior

I want the builder to import the component module App.

Actual behavior

It doesn't import the module and crashes with the error:

public/app/src/App.js` does not match the corresponding path on disk - File does not exist.

I underspend why it happens but why the default builder has a such behavior? Why i need import my module like this:
import App from './App/index.js'

It is not comfortable and I think it's bad to keep all the modules in the same directory without mention the css files... The default configuration contributes to use a bad folder hierarchy

@gaearon
Copy link
Contributor

gaearon commented Dec 12, 2016

Does restarting the server fix the issue?
I think it’s been reported before that it doesn’t “discover” a newly created file in this case.

If restarting works then this is a duplicate of #1164.

@DmitryOlkhovoi
Copy link
Author

@gaearon oh really restarting the server fix the issue.
Sorry for duplicate :(

@gaearon
Copy link
Contributor

gaearon commented Dec 12, 2016

Yea no worries. I agree it’s annoying.
I have no time to look into fixing this right now but feel free to dig in if you want to.

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants