You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
unejected version does not work for a subdirectory of another npm module #19
I tried create-react-app in a subdirectory of a different project. It did not work. Then when I ejected, it worked. It might be related to the file:/// thing - just filing an issue to get this recorded.
$ npm run create-react-app ../graphql-hacks/foobar cd ../graphql-hacks/foobar npm start
And then it failed with a bunch of errors similar to "Module not found: Error: Cannot resolve module 'webpack-dev-server/client' in /Users/lacker/graphql-hacks/foobar".
Oh, this is not supported (the argument is supposed to be the project name, not a path).
Maybe we should throw if it contains a slash to keep it simple.
I've tried it inside of jest ( https://github.com/facebook/jest ) and it throws with Cannot find module 'babel-eslint'. For some reason it reads the .babelrc file of jest instead of the one that is provided by the babel-loader. I'm trying to figure out what's going on.
Interesting. Maybe Babel still looks for .babelrc even though we're giving a config to babel-loader in a query. Perhaps it tries to merge them or something.
Okay, I got the Jest case working locally. It happens because of eslint config being autodiscovered. The only fix I found so far is to just embed the whole config into Webpack config, and pass useEslintrc: false.
Since we plan to maintain our own anyway, I’ll try to get this working.
I can reproduce the same problem if I just create it in a new directory that has no eslint. To get this I just did npm run create-react-app ~/blarg and then it could not find babel or webpack-dev-server/client. Does that work for you guys?
Activity
vjeux commentedon Jul 18, 2016
Can you be more precise for "it didn't work"?
gaearon commentedon Jul 18, 2016
How did you do it?
lacker commentedon Jul 18, 2016
$ npm run create-react-app ../graphql-hacks/foobarcd ../graphql-hacks/foobarnpm startAnd then it failed with a bunch of errors similar to "Module not found: Error: Cannot resolve module 'webpack-dev-server/client' in /Users/lacker/graphql-hacks/foobar".
graphql-hacks in this case already has a package.json. When I ejected, it worked. The resulting functional post-eject code is at https://github.com/lacker/graphql-hacks/tree/master/fromscratch if you are curious to see it.
gaearon commentedon Jul 18, 2016
Oh, this is not supported (the argument is supposed to be the project name, not a path).
Maybe we should throw if it contains a slash to keep it simple.
vjeux commentedon Jul 18, 2016
@gaearon the cli is designed to work with a path. I think the issue is the
isNodeModulesdetectionvjeux commentedon Jul 18, 2016
I've tried it inside of jest ( https://github.com/facebook/jest ) and it throws with Cannot find module 'babel-eslint'. For some reason it reads the .babelrc file of jest instead of the one that is provided by the babel-loader. I'm trying to figure out what's going on.
gaearon commentedon Jul 18, 2016
Interesting. Maybe Babel still looks for
.babelrceven though we're giving a config to babel-loader in aquery. Perhaps it tries to merge them or something.gaearon commentedon Jul 19, 2016
Okay, I got the Jest case working locally. It happens because of
eslintconfig being autodiscovered. The only fix I found so far is to just embed the whole config into Webpack config, and passuseEslintrc: false.Since we plan to maintain our own anyway, I’ll try to get this working.
lacker commentedon Jul 19, 2016
I can reproduce the same problem if I just create it in a new directory that has no eslint. To get this I just did

npm run create-react-app ~/blargand then it could not find babel or webpack-dev-server/client. Does that work for you guys?gaearon commentedon Jul 19, 2016
@lacker Can you still reproduce this with master? It works for me:
lacker commentedon Jul 19, 2016
Still doesn't work for me, but I'll open a new issue with more specific info.