Repository navigation
unejected version does not work for a subdirectory of another npm module #19
Description
Activity
Can you be more precise for "it didn't work"?
I tried create-react-app in a subdirectory of a different project.
How did you do it?
$ npm run create-react-app ../graphql-hacks/foobar
cd ../graphql-hacks/foobar
npm 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.
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.@gaearon the cli is designed to work with a path. I think the issue is the
isNodeModulesdetectionI'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
.babelrceven though we're giving a config to babel-loader in aquery. Perhaps it tries to merge them or something.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 Can you still reproduce this with master? It works for me:
Still doesn't work for me, but I'll open a new issue with more specific info.
- locked and limited conversation to collaborators
on Jan 23, 2019


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.