21
votes

I am getting the following error when using npm start to open create-react-app. I'm new to React and I have had no problems the past few days doing the command line to make a new app.

I have tried npx start, npm start and installed npm again for the updated version.

Failed to compile
./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css)
BrowserslistError: Unknown browser query `android all`. Maybe you are using old Browserslist or made typo in query.
    at Array.reduce (<anonymous>)
    at Array.some (<anonymous>)
    at Array.filter (<anonymous>)
5
That message is telling your that your CSS is failing to compile. Take a look at your index.css and see what is wrong with it. - dwjohnston
I just installed a fresh create-react-app and I am getting the same error.. - Orhan

5 Answers

35
votes

It is a new bug in BrowserList.

There are new reports on this both in create-react-app: https://github.com/facebook/create-react-app/issues/7239

and in browserlist: https://github.com/browserslist/browserslist/issues/382#issuecomment-502991170

As suggested by John Forbes below the workaround given on the github issue is to change the browserslist entry in package.json to

"browserslist": []

This will build and run the project.

2
votes

As proper temporal solution till bug fixing: add to package.json this:

  "resolutions": {
    "browserslist": "4.6.2",
    "caniuse-lite": "1.0.30000974"
  },
1
votes

At the moment you can try this and wait for further fix

"browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [  
    ]
  }
1
votes

I can confirm that forcing a yarn resolution for [email protected] fixes the error. It must be an issue with the latest [email protected] release.

temporary solution:

In package.json add

"resolutions": { "browserslist": "4.6.2", "caniuse-lite": "1.0.30000974" },

This method solved my problem.

0
votes

I tried updating the browserlist and then done this.

  1. Delete this part in package.json

    "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ],

  2. And run npm start

  3. It will ask for yes or no, give yes

Solved!