Skip to content

unejected version does not work for a subdirectory of another npm module #19

Description

@lacker

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.

Activity

  1. vjeux commented on Jul 18, 2016

    @vjeux
    Contributor

    Can you be more precise for "it didn't work"?

  2. gaearon commented on Jul 18, 2016

    @gaearon
    Contributor

    I tried create-react-app in a subdirectory of a different project.

    How did you do it?

  3. lacker commented on Jul 18, 2016

    @lacker
    ContributorAuthor

    $ 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".

    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.

  4. gaearon commented on Jul 18, 2016

    @gaearon
    Contributor

    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.

  5. vjeux commented on Jul 18, 2016

    @vjeux
    Contributor

    @gaearon the cli is designed to work with a path. I think the issue is the isNodeModules detection

  6. added this to the 0.1.0 milestone on Jul 18, 2016
  7. vjeux commented on Jul 18, 2016

    @vjeux
    Contributor

    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.

  8. gaearon commented on Jul 18, 2016

    @gaearon
    Contributor

    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.

  9. gaearon commented on Jul 19, 2016

    @gaearon
    Contributor

    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.

  10. lacker commented on Jul 19, 2016

    @lacker
    ContributorAuthor

    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?
    screen shot 2016-07-19 at 2 32 30 pm

  11. gaearon commented on Jul 19, 2016

    @gaearon
    Contributor

    @lacker Can you still reproduce this with master? It works for me:

    screen shot 2016-07-20 at 00 27 43

  12. lacker commented on Jul 19, 2016

    @lacker
    ContributorAuthor

    Still doesn't work for me, but I'll open a new issue with more specific info.

  13. locked and limited conversation to collaborators on Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions