Leonardocregis
Leonardocregis

Reputation: 95

error BrowserlistsError from create-react-app npm run-script build

I created a project using the cli utility create-react-app. When i use the npm start, all works as expected.

But when i try to run "npm run-script build" i get the error below:

./src/index.css Module build failed: BrowserslistError: Unknown browser query 'dead' at Array.forEach (<anonymous>)

I have the folowing structure of the package.json

`{
  "name": "site",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.2.0",
    "react-bootstrap": "^0.32.1",
    "react-dom": "^16.2.0",
    "react-router-dom": "^4.2.2",
    "react-scripts": "1.1.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}`

It builds if i remove the "not dead" , but i feel like i am creating some future problems. Do somebody got this error ? Knows the workaround, do i have to worry about taking off this ?

Upvotes: 4

Views: 881

Answers (1)

Pranesh
Pranesh

Reputation: 27

Temporary Solution : make browserlist as empty

{ "name": "site", "version": "0.1.0", "private": true, "dependencies": { "react": "^16.2.0", "react-bootstrap": "^0.32.1", "react-dom": "^16.2.0", "react-router-dom": "^4.2.2", "react-scripts": "1.1.1" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": "react-app" }, "browserslist": [] }

Upvotes: 1

Related Questions