Create-react-app: Error: Cannot find module 'react-error-overlay/middleware'

Created on 8 Sep 2017  路  5Comments  路  Source: facebook/create-react-app

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes. [email protected] [email protected] [email protected]

Which terms did you search for in User Guide?

Error: Cannot find module 'react-error-overlay/middleware'

Environment

  1. node -v: v7.10.1
  2. npm -v: v5.4.1
  3. yarn --version (if you use Yarn): 1.0.0
  4. npm ls react-scripts (if you haven鈥檛 ejected):

Then, specify:

  1. Operating system: Ubuntu 16.04
  2. Browser and version (if relevant):

Steps to Reproduce

(Write your steps here:)

  1. yarn install
  2. yarn start

Expected Behavior

No error

Actual Behavior

yarn start v1.0.0
$ node scripts/start.js
module.js:472
    throw err;
    ^

Error: Cannot find module 'react-error-overlay/middleware'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
.
.
.
question

Most helpful comment

@xMihai

const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');

All 5 comments

It seems like you've ejected and then bumped major versions of react-error-overlay & react-dev-utils, or similar.

It is not expected that you can upgrade these packages beyond their major version once you've ejected -- you need to track the breaking changes and incorporate the changes you've missed since ejecting react-scripts, or simply leave those dependencies static.

I'll close as it's not a problem with our package, but am more than happy to give you more support if downgrading versions does not resolve this for you.

@xMihai

const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');

hey Jack-works - what do you mean modify build.js? modify in what way? thank you

I solved this issue by replacing any require of:

  • react-error-overlay by react-dev-utils/webpackHotDevClient
  • react-error-overlay/middleware by react-dev-utils/errorOverlayMiddleware

Only had to modify config files

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alleroux picture alleroux  路  3Comments

dualcnhq picture dualcnhq  路  3Comments

oltsa picture oltsa  路  3Comments

AlexeyRyashencev picture AlexeyRyashencev  路  3Comments

barcher picture barcher  路  3Comments