question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AstroTurfLoaderError: Cannot use the decorators and decorators-legacy plugin together

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
jquensecommented, Sep 30, 2020

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

0reactions
jsg2021commented, Oct 1, 2020

Yeah, that could even be articulated in the setup for people targeting very old runtimes… or error at startup?

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found