Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

248
Views
Update webpack 4 to webpack 5 on an existing create-react-app ejected with react-app-rewired

I have an existing old react application, created with create-react-app and ejected with react-app-rewired. I'm updating the deprecated dependencies. I've already updated react-scripts to the current version (4.0.3) and everything works fine. But I need to update the style-loader lib, and this new version requires webpack 5.

The current react-scripts version is using webpack 4:

> npm ls webpack
my-app@0.1.0
└─┬ react-scripts@4.0.3
  └── webpack@4.44.2 

I found a project named webpack-5-react-script: https://www.npmjs.com/package/webpack-5-react-scripts. It seems what I need, but as my project was ejected using react-app-rewired a long time ago, I get this error when I run npm start:

Error: Cannot find module 'react-scripts/package.json'
Require stack:
- /home/.../my-app/node_modules/react-app-rewired/scripts/utils/paths.js
- /home/../my-app/node_modules/react-app-rewired/scripts/start.js

What I can do? Has anybody faced this issue?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

React app rewired start, calls react-scripts start, you would need to edit react app rewired to call webpack5-react-scripts instead.

about 4 years ago · Juan Pablo Isaza Report

0

Just download react-scripts 5.0.0 into your project?

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!