AstroTurfLoaderError: Cannot use the decorators and decorators-legacy plugin together
See original GitHub issueI’m looking for css-in-js library for my project, linaria
and astroturf
are in my preference.
astroturf
looks better for me because we already use css modules using .less
.
The problem is when I use { legacy: true }
for @babel/plugin-proposal-decorators
build will crash with error message: AstroTurfLoaderError: Cannot use the decorators and decorators-legacy plugin together
.
My babel config is:
{
presets: [
['@babel/preset-env', {
loose: true,
}],
'@babel/preset-react',
],
plugins: [
'@babel/plugin-syntax-dynamic-import',
[
'@babel/plugin-proposal-decorators',
{ legacy: true },
],
'@babel/plugin-proposal-object-rest-spread',
['@babel/plugin-proposal-class-properties', { loose: true }],
[
'@babel/plugin-transform-runtime',
{
corejs: false,
helpers: true,
regenerator: true,
useESModules: false,
},
],
],
}
What i do wrong?
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Cannot use the decorators and decorators-legacy plugin ...
The problem is when I use { legacy: true } for @babel/plugin-proposal-decorators build will crash with error message: AstroTurfLoaderError: ...
Read more >Babel 7 update mucking up jest tests with Cannot use the ...
I solved this problem npm install -D @babel/plugin-proposal-decorators and "test": { "plugins": [["@babel/plugin-proposal-decorators", ...
Read more >Developers - AstroTurfLoaderError: Cannot use the decorators and ...
AstroTurfLoaderError : Cannot use the decorators and decorators-legacy plugin together ... I'm looking for css-in-js library for my project, linaria and astroturf ...
Read more >Storybook Nuxt Build Does Not Includes Decorators - ADocLib
<p>Cannot use the decorators and decorators-legacy plugin together <p>I did not add any new plugins to package.json. This is the output of yarn...
Read more >babel-plugin-transform-decorators-legacy - npm package - Snyk
All security vulnerabilities belong to production dependencies of direct and indirect packages. License: MIT. Security Policy: No.
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
It’s not intentionally opinionated, the parser requires picking one. Last I tried the two options were not compatible with each other. If that’s different now I’m certainly open to it
Nevermind, this loader doesn’t transform the tag template literals… yeah, it’s better to just ensure the parser can at least handle tags and let the user’s config fill in the rest.