3

I've been trying to use ES2020 features like optional chaining feature in next.js but it needs to a new loader, how do I fix this?

S. Hesam
  • 5,266
  • 3
  • 37
  • 59

2 Answers2

1

You should add this plugin in devDependencies in package.json file

"devDependencies": {
        "@babel/plugin-proposal-optional-chaining": "^7.9.0",
    }

then run this command

npm install
S. Hesam
  • 5,266
  • 3
  • 37
  • 59
1

Just run

npm install --save-dev @babel/plugin-proposal-optional-chaining
S. Hesam
  • 5,266
  • 3
  • 37
  • 59