score:1

per this issue, it may be a problem with the react-scripts part of your library. so either use a specific, older version of create react app by running :

npx create-react-app@4.0.1 my-app

or by running cra as is, then modifying your package.json folder so that the react script version is specified.

so after you run cra, change your package.json file like so:

{
  "name": "myapp",
  ...
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.4.0",
    "@testing-library/user-event": "^7.2.1",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-scripts": "4.0.1"           // change this line to 4.0.1
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  ...
}

then make sure you rm -rf node_modules then run npm install to get a fresh install that removes whatever react-scripts came by default so that you use the specific 4.0.1 version.


Related Query

More Query from same tag