babel: On update to version 7.00-beta.46 Get Decorators Support Error [BUG]
This is error I get,
The new decorators proposal is not supported yet. You must pass the
"decoratorsLegacy": true option to @babel/preset-stage-2 (While processing
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 13
- Comments: 23 (10 by maintainers)
I think the error message is correct? I believe I made it pretty clear above, but it’s
Also like I mentioned if you use
"@babel/core": "^7.0.0-beta.44",
and we make an intentional breaking change it will break the build automatically. That’s why I’m suggesting people pin the version while in beta (we’ve tried to suggest this since it’s not released but difficult to get that message across especially when it’s the default)Can you kindly update the docs, as to how to resolve this breaking change. As to what changes are required to make in
.babelrc
file.Thank you so much for reaching out & helping with this, I’ll write an article about this with a publication like freeCodeCamp & try to spread the word out.
I see. Still, it doesn’t seem reasonable that the default behaviour of stage <= 2 presets is to crash the build.
So everyone’s on the same page here. Babel is still in beta, and we are still making breaking changes. If you are using a prerelease version of any package, you should be using a lockfile and only upgrading it when you’re ready to test out the new version, just like if it were a new major version release.
Personally I wouldn’t use
^
in the version at all, but if you want to, you must at least use a lockfile or else you are opting into instability.Don’t want to speak for @nicolo-ribaudo but he probably meant
@babel/plugin-proposal-decorators
["@babel/plugin-transform-decorators", { "legacy": true }]
I’m a bit confused, is this article about this bug, about Babel 7, or my comment about pinning the version in beta?
Was the error message not clear enough in your opinion? I know it assumes knowledge about presets/options.
I’m going to close this either way though, the message is correct! Thanks.
My
.package.json
file’s dev dependencies look something like this.