Closed marcolilli closed 2 years ago
Any solution for this issue ?
I am not able to duplicate this and suspect that there is a combination of libraries in use that is contributing to the problem, as with essentially a clean create-react-app project with react-app-rewired added it does not occur - at least, not on my OS/machine.
Example repository used: https://github.com/dawnmist/react-app-rewired-test-520
Steps taken:
node_modules/web-vitals
build
script in package.json
to use react-app-rewired
instead of react-scripts
react-app-rewired build
through yarn, through npm, and directly.Result: Every run exited once the run failed due to the missing web-vitals
package.
Tested with both nodejs versions 10.23.3 and 12.20.2 in case it was a version issue with nodejs, running on Debian 10 'Buster' version of linux.
username@host (master *)> ./node_modules/.bin/react-app-rewired build
Creating an optimized production build...
Failed to compile.
./src/reportWebVitals.tsx
Cannot find module: 'web-vitals'. Make sure this package is installed.
You can install this package by running: yarn add web-vitals.
PWD: ~/src/react-app-rewired-test-520
username@host (master *)> yarn build
yarn run v1.22.5
$ react-app-rewired build
Creating an optimized production build...
Failed to compile.
./src/reportWebVitals.tsx
Cannot find module: 'web-vitals'. Make sure this package is installed.
You can install this package by running: yarn add web-vitals.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PWD: ~/src/react-app-rewired-test-520
username@host (master *)> npm run-script build
> react-app-rewired-test-520@0.1.0 build /home/username/src/react-app-rewired-test-520
> react-app-rewired build
Creating an optimized production build...
Failed to compile.
./src/reportWebVitals.tsx
Cannot find module: 'web-vitals'. Make sure this package is installed.
You can install this package by running: yarn add web-vitals.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-app-rewired-test-520@0.1.0 build: `react-app-rewired build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-app-rewired-test-520@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/username/.npm/_logs/datetime-debug.log
I will need more information on what is going on to be able to take this any further, particularly OS (and shell used if Windows) and if possible an example repository that reproduces/demonstrates the problem.
I'd also ask if someone who is experiencing the issue please test this on the example repository I posted above using the same set of steps listed above on their machine to see if my example repository demonstrates the issue on their machine as well, to narrow down whether it is something specific to the project that experiences this verses occurring on all projects on that machine.
@dawnmist Thank you for you effort. I'll test the repository you provided in our infrastructure and let you know if I have any news.
Environment
Issue
When run
react-app-rewired build
on a project with a missing dependency (is required in code but does not exist in package.json) the script shows an error but does not exit. This is a problem since it leads to never ending build pipelines in my CI/CD.Steps to reproduce
react-app-rewired build
Expected: Script exits on error Actually: Script displays error but keeps running
Console output