Running into troubles when updating react-scripts from 4.0.3 to 5.0.x

180 Views Asked by At

My React project has a few critical npm vulnerabilities. After following the instructions from React's docs on updating react-scripts from 4.0.x to 5.0.0, npm/yarn will install libraries correctly, but when running we get this issue:

/Users/.../node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

TypeError: Cannot read properties of undefined (reading 'toString')
    at /Users/.../node_modules/webpack/lib/cache/PackFileCacheStrategy.js:1250:53
    at async Promise.all (index 26)
error Command failed with exit code 1.
  • I've tried deleting the node_modules folder & .lock files and then using both npm and yarn multiple times to reinstall/rerun.
  • Tried using a few different versions of the node via NVM.
  • Tried creating a new create-react app and adding in the new dependencies to that project. It succeeded and ran, but when trying in our project, it will fail (granted our project is significantly more complex than the default CRA template).
  • My next step seems to lead me towards needing to just inject our project's code into the CRA template until the breaking piece rears its head and we can troubleshoot further from there, but this is taking enough time already and that process would be much more intensive.

I've tried figuring this out for a few days but nothing seems to change this outcome. Would be super helpful to get some information from anyone else who has dealt with similar react-scripts updating issues.

Thanks!

0

There are 0 best solutions below