21

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>)
Masoud Darvishian
  • 3,754
  • 4
  • 33
  • 41
DGB
  • 1,252
  • 2
  • 16
  • 32
  • 2
    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 Jun 18 '19 at 08:16
  • I just installed a fresh create-react-app and I am getting the same error.. – Orhan Jun 18 '19 at 08:24

5 Answers5

35

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.

Orhan
  • 1,395
  • 13
  • 12
  • 6
    The workaround given on the github issue is to change the browserslist entry in package.json to ```"browserslist": []``` – John Forbes Jun 18 '19 at 08:48
2

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

  "resolutions": {
    "browserslist": "4.6.2",
    "caniuse-lite": "1.0.30000974"
  },
AxaZol
  • 21
  • 3
1

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

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

I can confirm that forcing a yarn resolution for caniuse-lite@1.0.30000974 fixes the error. It must be an issue with the latest caniuse-lite@1.0.30000975 release.

temporary solution:

In package.json add

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

This method solved my problem.

1

I tried updating the browserlist and then did this.

  1. Delete this part in package.json
    "browserslist": {
        "production": [
          ">0.2%",
          "not dead",
          "not op_mini all"
        ],
  1. And run npm start

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

Solved!

Sagar Darekar
  • 982
  • 9
  • 14
front_end
  • 29
  • 6