create-react-app: Migrating from 0.9.5 to 1.0.0 > source-map-generator.js error

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.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

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

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

also happens on my macOS Sierra notebook