I'm using babel.config.js with the following presets:
presets: [
'next/babel', {
'preset-env': {
'targets': '> 0.25%',
},
},
'@emotion/babel-preset-css-prop',
],
This is currently throwin an error trying to run the app
[ error ] ./node_modules/next/dist/client/dev/amp-dev.js
ReferenceError: [BABEL] ~REDACTED~/node_modules/next/dist/client/dev/amp-dev.js: Unknown option: .preset-env. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
Pretty sure preset-env is valid... Am I missing something?
Nextjs version : 9.0.1
This does not seem to be a bug in Next.js, please use Spectrum for questions
I guess you're simply missing additional pair of [ ] here:
presets: [
- 'next/babel', {
+ ['next/babel', {
'preset-env': {
'targets': '> 0.25%',
},
- },
+ }],
'@emotion/babel-preset-css-prop',
],
Well, that was embarassing 馃槩
Thanks! And sorry about that.
Most helpful comment
This does not seem to be a bug in Next.js, please use Spectrum for questions
I guess you're simply missing additional pair of
[ ]here:Example: https://github.com/zeit/next.js/blob/9c8d34d551e1a3729d91c86f0b62547f0d79044f/examples/custom-server-typescript/.babelrc