I have a nextjs
app with redux
.
When I try to use the ??
operator in my pages/index
, it works as it should.
I then tried to load up a redux
store with a bunch of reducers. When I hit the ??
in a reducer file, I get this error:
Support for the experimental syntax 'optionalChaining' isn't currently enabled (71:32):
I also get the error in any other file: component, actions and reducers. It is only directly in the pages/*
that the plugin is working properly.
My app is using next@9.1.1
and redux@4.0.4
. Here is my .babelrc
file:
"env": {
"development": {
"presets": ["next/babel"],
"plugins": [
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",
[
"styled-components",
{ "ssr": true, "displayName": true, "preprocess": false }
]
]
}
}
}
Is there something that would override my babel
config for certain files? If so, what am I missing? What else should I look at?