Decorators are broken in 7
See original GitHub issueBug Report
Current Behavior
Follow up to https://github.com/babel/babel/issues/7786 . No idea why that issue is closed, with a cliff-hanger. If you add {legacy: true}
option to the plugin, you’ll again get the error about the syntax not being enabled.
Input Code
@observer
class TextInput {}
Expected behavior/code It works
Babel Configuration (.babelrc, package.json, cli command)
{
plugins: [
...,
['@babel/plugin-proposal-decorators', {legacy: true}],
],
}
Environment
- Babel version(s): [v7.0.0-beta.46]
- Node/npm version: [e.g. Node 9.2.1/yarn 1.5.1]
- Monorepo [e.g. no]
- How you are using Babel: [
loader
]
Additional context/Screenshots So basically it goes like this:
First you get a warning Support for the experimental syntax 'decorators' isn't currently enabled
. You add '@babel/plugin-proposal-decorators'
to your plugins, you then get a warning about needing legacy
option, you add the legacy option and you’re back at Support for the experimental syntax 'decorators' isn't currently enabled
warning.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:21
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Please Fix Your Decorators - Hynek Schlawack
Sadly most decorators are broken because the web is full of bad advice. (Feel free to jump directly to the conclusion if you...
Read more >"Class is using Angular features but is not decorated. Please ...
Q: Angular components broken - "Class is using Angular features but is not decorated. Please add an explicit Angular decorator" · Ask Question....
Read more >Primer on Python Decorators
In this introductory tutorial, we'll look at what Python decorators are and how to create and use them.
Read more >Cake Decorator Jobs, Employment in Oklahoma | Indeed.com
Shift Leader/Cake Decorator. Marble Slab Creamery & Great American Cookies. Broken Arrow, OK. Estimated $18.4K - $23.3K a year. Full-time +1.
Read more >Memphis Light Oak 8 mm Thick x 7-2/3 in. Wide x 50-5/8 in ...
Home Decorators Collection Memphis Light Oak has rich gray color tones and deep graining that present a warm and inviting look to complement...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here is an example
babel.config.js
(you should delete .babelrc):Could you elaborate a bit more on this @abologna-r7 ?