简体   繁体   中英

Error: Support for the experimental syntax 'optionalChaining' isn't currently enabled, but it is

I've followed the instructions here and here and I've added the following to my package.json

},
"babel": {
    "plugins": [
        "@babel/plugin-proposal-nullish-coalescing-operator",
        "@babel/plugin-proposal-optional-chaining"
    ]
},
"dependencies": {

But I'm still getting the error

Support for the experimental syntax 'optionalChaining' isn't currently enabled

What am I doing wrong here?

Okay I am bit late here, but I can see the question is still active, for those come later:

At the time of writing, optional chaining might not work in NUXT project with node > 12, try using the current LTS version (node 12).

I think the issue might related to one or more dependencies of NUXT but we didn't investigate further, using node 12 resolves the issue for us.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM