After adding decko
(Support for decorators) as well as adding support for experimetalDecoractors
in my tsconfig.js
Just figured it out, I needed to add the plugin to the production
part of my config for the build to work X_x
{
"env": {
"development": {
"presets": [
"next/babel",
"@zeit/next-typescript/babel"
],
"plugins": [
[
"styled-components",
{
"ssr": true,
"displayName": true
}
],
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
]
},
"production": {
"presets": [
"next/babel",
"@zeit/next-typescript/babel"
],
"plugins": [
[
"styled-components",
{
"ssr": true,
"displayName": true
}
],
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
]
},
i'm seeing something similar on my end, but i think you can do this:
{
"presets": ["next/babel"],
"plugins": [["@babel/plugin-proposal-decorators", { "legacy": true }]],
"env": {...}
}
Seems like you can have global plugins for all the things, vs setting it all up for each one. would be yawnsome otherwise.
Note for Next.JS NX users, there is currently an open (12/2020) issue for this error on their github at: github.com/nrwl/nx/issues/3322
I have tried to fix this problem using several solutions in combination, but have not succeeded yet.