How to fix error “Failed to compile : ./node_modules/@react-leaflet/core/esm/path.js 10:41 Module parse failed: Unexpected token (10:41)”

I found a way to fix it.

Steps to fix:

Open your package.json file and edit your browserslist as follows.

From ?? Operator results in “Unexpected Token” err when used in package #9468:

 "browserslist": {
   "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
},

to

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

Once you’ve done this, delete the node_modules/.cache directory.

Then try npm install.

And npm start

Tadaaa!

References:

  • ?? Operator results in “Unexpected Token” err when used in package #9468
  • Module parse failed: Unexpected token (10:41) in @react-leaflet/core/esm/path.js #877

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)