Skip to content

Migrating from 0.9.5 to 1.0.0 > source-map-generator.js error #2232

Description

@barbalex

Can you reproduce the problem with latest npm?

yes

Description

I followed the migration instructions.

Actually I first followed the instructions "How to turn my app into a Progressive Web App" because I had done this following the previous instructions some months ago. Then I ran npm start: app started up with no errors.

Then ran npm install --save-dev --save-exact react-scripts@1.0.0

App did not start, errors in console see below.

Nuked node-modules, ran npm i, then npm start. Still same errors.

Expected behavior

App starts up

Actual behavior

App hangs on startup. Messages in the console:

C:\Users\alex\apf2\node_modules\source-map\lib\source-map\source-map-generator.js:8 Uncaught Error: Cannot find module "."
    at webpackMissingModule (C:\Users\alex\apf2\node_modules\source-map\lib\source-map\source-map-generator.js:8)
    at Object.<anonymous> (C:\Users\alex\apf2\node_modules\source-map\lib\source-map\source-map-generator.js:8)
    at Object.<anonymous> (C:\Users\alex\apf2\node_modules\source-map\lib\source-map\source-map-generator.js:400)
    at __webpack_require__ (C:\Users\alex\apf2\webpack\bootstrap c96fbe2…:657)
    at fn (C:\Users\alex\apf2\webpack\bootstrap c96fbe2…:85)
    at Object.<anonymous> (C:\Users\alex\apf2\node_modules\source-map\lib\source-map.js:6)
    at __webpack_require__ (C:\Users\alex\apf2\webpack\bootstrap c96fbe2…:657)
    at fn (C:\Users\alex\apf2\webpack\bootstrap c96fbe2…:85)
    at Object.defineProperty.value (C:\Users\alex\apf2\node_modules\react-error-overlay\lib\utils\getSourceMap.js:1)
    at __webpack_require__ (C:\Users\alex\apf2\webpack\bootstrap c96fbe2…:657)

C:\Users\alex\apf2\node_modules\react-dev-utils\webpackHotDevClient.js:226 ./~/source-map/lib/source-map/source-map-generator.js
8:45-52 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected): react-scripts@1.0.0
  2. node -v: v7.10.0
  3. npm -v: 4.6.1

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version: Chrome 58.0.3029.110 (64-bit)

Reproducible Demo

This is my app.

I really can't face reducing this big project. I would probably produce a lot of new errors instead :-(

I'm hoping that others run into the same error and maybe have a less complex app which is easier to reduce.

What I did do is revert to "react-scripts": "0.9.5". Result: app starts without errors.
Upgrade to "react-scripts": "1.0.0": App errors out again.

Activity

  1. gaearon commented on May 19, 2017

    @gaearon
    Contributor

    Thanks for reporting. Will look later today!

  2. barbalex commented on May 19, 2017

    @barbalex
    Author

    also happens on my macOS Sierra notebook

  3. gaearon commented on May 19, 2017

    @gaearon
    Contributor

    If you'd like to dig into why this happens (or have a smaller repro case) I’d appreciate it!

  4. barbalex commented on May 19, 2017

    @barbalex
    Author

    The update worked flawlessly in another project of mine so obviously this error has to do with project specifics :-(

  5. gaearon commented on May 19, 2017

    @gaearon
    Contributor

    @Timer might have more insight than me here.

  6. Timer commented on May 19, 2017

    @Timer
    Contributor

    Just cloned your project and upgraded react-scripts; I can't get this to reproduce.

    Can you please push me a branch (or direct me to one) with this happening? Thanks!

  7. barbalex commented on May 19, 2017

    @barbalex
    Author

    Scratching my head...

    This happens to me when using master.

    I now nuked my entire project locally, cloned it from github, updated react-scripts to 1.0.0. And get the error again.

    ??

  8. barbalex commented on May 19, 2017

    @barbalex
    Author

    Anyway: thanks a lot for caring!

  9. barbalex commented on May 19, 2017

    @barbalex
    Author

    @Timer : do you also get this warning (which I get following the error):

    ./~/source-map/lib/source-map/source-map-generator.js
    8:45-52 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
    
  10. phillipj commented on May 19, 2017

    @phillipj

    Seeing this on a project of mine as well, which also uses storybooks. Made a repo that reproduces this on my machine: https://github.com/phillipj/create-react-app-v1-upgrade

    OS: macOS v10.11.6
    Node.js/npm: v6.10.3/v3.10.10

    Steps made to create the project above:

    $ create-react-app --scripts-version=0.9.5 .
    $ getstorybook
    $ npm install --save-dev --save-exact react-scripts@1.0.0
    
    npm WARN extract-text-webpack-plugin@2.1.0 requires a peer of webpack@^2.2.0 but none was installed.
    npm WARN webpack-dev-server@2.4.5 requires a peer of webpack@^2.2.0 but none was installed.
    
    $ npm ls webpack
    create-react-app-v1-upgrade@0.1.0 /create-react-app-v1-upgrade
    └─┬ @kadira/storybook@2.35.3
      └── webpack@1.14.0
  11. Timer commented on May 19, 2017

    @Timer
    Contributor

    I do not get that warning, but I'm using yarn. Let me try again with npm.

  12. phillipj commented on May 19, 2017

    @phillipj

    Forgot to mention, I see this in the npm output when installing cra@1.0.0:

    └─┬ react-scripts@1.0.0
    
      ...
    
      ├─┬ UNMET PEER DEPENDENCY webpack@2.5.1
  13. Timer commented on May 19, 2017

    @Timer
    Contributor

    Ah, yes this replicates for me when using npm ... I wonder what's different.

  14. Timer commented on May 19, 2017

    @Timer
    Contributor

    Seems NPM is deduping the wrong package, but it shouldn't cause webpack to acquire the incorrect version...

    package trees Yarn: ``` Joes-MacBook-Pro:apf2 joe$ npm ls source-map apf2@0.1.0 /Users/joe/Desktop/temp/apf2 ├─┬ leaflet-measure@2.1.7 │ └─┬ brfs@1.4.3 │ └─┬ static-module@1.3.2 │ ├─┬ escodegen@1.3.3 │ │ └── source-map@0.1.43 │ └─┬ static-eval@0.2.4 │ └─┬ escodegen@0.0.28 │ └── source-map@0.5.6 deduped └─┬ react-scripts@1.0.0 ├─┬ autoprefixer@7.1.0 │ └─┬ postcss@6.0.1 │ └── source-map@0.5.6 deduped ├─┬ babel-core@6.24.1 │ ├─┬ babel-generator@6.24.1 │ │ └── source-map@0.5.6 deduped │ ├─┬ babel-register@6.24.1 │ │ └─┬ source-map-support@0.4.15 │ │ └── source-map@0.5.6 deduped │ └── source-map@0.5.6 ├─┬ css-loader@0.28.1 │ ├─┬ cssnano@3.10.0 │ │ └─┬ postcss-svgo@2.1.6 │ │ └─┬ svgo@0.7.2 │ │ └─┬ csso@2.3.2 │ │ └── source-map@0.5.6 deduped │ └─┬ postcss@5.2.17 │ └── source-map@0.5.6 deduped ├─┬ extract-text-webpack-plugin@2.1.0 │ └─┬ webpack-sources@0.1.5 │ └── source-map@0.5.6 deduped ├─┬ html-webpack-plugin@2.28.0 │ └─┬ html-minifier@3.5.0 │ ├─┬ clean-css@4.1.3 │ │ └── source-map@0.5.6 deduped │ └─┬ uglify-js@3.0.9 │ └── source-map@0.5.6 deduped ├─┬ jest@20.0.3 │ └─┬ jest-cli@20.0.3 │ ├─┬ istanbul-api@1.1.8 │ │ └─┬ istanbul-reports@1.1.0 │ │ └─┬ handlebars@4.0.8 │ │ └── source-map@0.4.4 │ ├─┬ istanbul-lib-source-maps@1.2.0 │ │ └── source-map@0.5.6 deduped │ └─┬ jest-environment-jsdom@20.0.3 │ └─┬ jsdom@9.12.0 │ └─┬ escodegen@1.8.1 │ └── source-map@0.2.0 ├─┬ postcss-flexbugs-fixes@3.0.0 │ └─┬ postcss@6.0.1 │ └── source-map@0.5.6 deduped ├─┬ postcss-loader@2.0.5 │ └─┬ postcss@6.0.1 │ └── source-map@0.5.6 deduped ├─┬ react-dev-utils@1.0.0 │ └─┬ stack-frame-mapper@0.4.0 │ └─┬ stack-frame-utils@0.4.0 │ └── source-map@0.5.6 deduped ├─┬ sw-precache-webpack-plugin@0.9.1 │ └─┬ uglify-js@2.8.26 │ └── source-map@0.5.6 deduped └─┬ webpack@2.5.1 ├── source-map@0.5.6 deduped └─┬ webpack-sources@0.2.3 └── source-map@0.5.6 deduped ```

    NPM:

    Joes-MacBook-Pro:apf2 joe$ npm ls source-map
    apf2@0.1.0 /Users/joe/Desktop/temp/apf2
    ├─┬ leaflet-measure@2.1.7
    │ └─┬ brfs@1.4.3
    │   └─┬ static-module@1.3.2
    │     ├─┬ escodegen@1.3.3
    │     │ └── source-map@0.1.43 
    │     └─┬ static-eval@0.2.4
    │       └─┬ escodegen@0.0.28
    │         └── source-map@0.1.43  deduped
    └─┬ react-scripts@1.0.0
      ├─┬ autoprefixer@7.1.0
      │ └─┬ postcss@6.0.1
      │   └── source-map@0.5.6 
      ├─┬ babel-core@6.24.1
      │ ├─┬ babel-generator@6.24.1
      │ │ └── source-map@0.5.6 
      │ ├─┬ babel-register@6.24.1
      │ │ └─┬ source-map-support@0.4.15
      │ │   └── source-map@0.5.6 
      │ └── source-map@0.5.6 
      ├─┬ css-loader@0.28.1
      │ ├─┬ cssnano@3.10.0
      │ │ ├─┬ postcss@5.2.17
      │ │ │ └── source-map@0.5.6 
      │ │ ├─┬ postcss-calc@5.3.1
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-colormin@2.2.2
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-convert-values@2.6.1
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-discard-comments@2.0.4
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-discard-duplicates@2.1.0
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-discard-empty@2.1.0
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-discard-overridden@0.1.1
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-discard-unused@2.2.3
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-filter-plugins@2.0.2
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-merge-idents@2.1.7
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-merge-longhand@2.0.2
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-merge-rules@2.1.2
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-minify-font-values@1.0.5
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-minify-gradients@1.0.5
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-minify-params@1.2.2
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-minify-selectors@2.1.1
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-normalize-charset@1.1.1
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-normalize-url@3.0.8
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-ordered-values@2.2.3
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-reduce-idents@2.4.0
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-reduce-initial@1.0.1
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-reduce-transforms@1.0.4
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ ├─┬ postcss-svgo@2.1.6
      │ │ │ ├─┬ postcss@5.2.17
      │ │ │ │ └── source-map@0.5.6 
      │ │ │ └─┬ svgo@0.7.2
      │ │ │   └─┬ csso@2.3.2
      │ │ │     └── source-map@0.5.6 
      │ │ ├─┬ postcss-unique-selectors@2.0.2
      │ │ │ └─┬ postcss@5.2.17
      │ │ │   └── source-map@0.5.6 
      │ │ └─┬ postcss-zindex@2.2.0
      │ │   └─┬ postcss@5.2.17
      │ │     └── source-map@0.5.6 
      │ ├─┬ postcss@5.2.17
      │ │ └── source-map@0.5.6 
      │ ├─┬ postcss-modules-extract-imports@1.0.1
      │ │ └─┬ postcss@5.2.17
      │ │   └── source-map@0.5.6 
      │ ├─┬ postcss-modules-local-by-default@1.1.1
      │ │ └─┬ postcss@5.2.17
      │ │   └── source-map@0.5.6 
      │ ├─┬ postcss-modules-scope@1.0.2
      │ │ └─┬ postcss@5.2.17
      │ │   └── source-map@0.5.6 
      │ └─┬ postcss-modules-values@1.2.2
      │   └─┬ postcss@5.2.17
      │     └── source-map@0.5.6 
      ├─┬ extract-text-webpack-plugin@2.1.0
      │ └─┬ webpack-sources@0.1.5
      │   └── source-map@0.5.6 
      ├─┬ html-webpack-plugin@2.28.0
      │ └─┬ html-minifier@3.5.0
      │   ├─┬ clean-css@4.1.3
      │   │ └── source-map@0.5.6 
      │   └─┬ uglify-js@3.0.9
      │     └── source-map@0.5.6 
      ├─┬ jest@20.0.3
      │ └─┬ jest-cli@20.0.3
      │   ├─┬ istanbul-api@1.1.8
      │   │ └─┬ istanbul-reports@1.1.0
      │   │   └─┬ handlebars@4.0.8
      │   │     ├── source-map@0.4.4 
      │   │     └─┬ uglify-js@2.8.27
      │   │       └── source-map@0.5.6 
      │   ├─┬ istanbul-lib-source-maps@1.2.0
      │   │ └── source-map@0.5.6 
      │   └─┬ jest-environment-jsdom@20.0.3
      │     └─┬ jsdom@9.12.0
      │       └─┬ escodegen@1.8.1
      │         └── source-map@0.2.0 
      ├─┬ react-dev-utils@1.0.0
      │ └─┬ stack-frame-mapper@0.4.0
      │   └─┬ stack-frame-utils@0.4.0
      │     └── source-map@0.5.6 
      ├─┬ sw-precache-webpack-plugin@0.9.1
      │ └─┬ uglify-js@2.8.27
      │   └── source-map@0.5.6 
      └─┬ webpack@2.5.1
        ├── source-map@0.5.6 
        ├─┬ uglify-js@2.8.27
        │ └── source-map@0.5.6  deduped
        └─┬ webpack-sources@0.2.3
          └── source-map@0.5.6  deduped
    
  15. added a commit that references this issue on May 19, 2017
    5e06c6e
  16. Timer commented on May 19, 2017

    @Timer
    Contributor

    Fix up in #2243

  17. added a commit that references this issue on May 19, 2017
    70a7f28
  18. barbalex commented on May 19, 2017

    @barbalex
    Author

    thanks guys, you are amazing!

  19. gaearon commented on May 19, 2017

    @gaearon
    Contributor

    react-scripts@1.0.1 should be out with a fix.
    Can you please verify it helps?

  20. barbalex commented on May 19, 2017

    @barbalex
    Author

    works like a charm :-)

  21. added a commit that references this issue on Jul 10, 2017
    4e5b4c1
  22. added a commit that references this issue on Aug 2, 2017
    6f3e256
  23. locked and limited conversation to collaborators on Jan 21, 2019
  24. added a commit that references this issue on Oct 8, 2024
    42d8347
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions