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.

"Disabled SWC as replacement for Babel because of custom Babel configuration"?

See original GitHub issue

One of the big upgrades in Next 12 is use of the fast rust compiler SWC. Is there any way this .babelrc could be altered or removed while maintaining project functionality?

{
  "presets": [
    [
      "next/babel",
      {
        "styled-jsx": {
          "plugins": ["styled-jsx-plugin-postcss"]
        }
      }
    ]
  ]
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ixartzcommented, Jan 4, 2022

I have already spend several days looking for a solution. Currently, there aren’t any solution I’m totally satisfy.

Someone already shared the babel config for SWC support: https://github.com/vercel/next.js/discussions/30174#discussioncomment-1539922

Maybe we should wait Vercel to add support?

I’m totally open for ideas.

0reactions
ixartzcommented, Mar 14, 2022

@oliverpatrick @andrewschreiber I just remove styled-jsx-plugin-postcss and .babelrc. By default, the boilerplate now uses SWC compiler and the warning is now removed: “Disabled SWC as replacement for Babel because of custom Babel configuration”

Read more comments on GitHub >

github_iconTop Results From Across the Web

warn - Disabled SWC as replacement for Babel because of ...
A simple solution would be to remove the .babelrc file and add the following code in the jest.config.js file : // ... transform:...
Read more >
swc-disabled - Next.js
When an application has custom Babel configuration Next.js will automatically opt-out of using SWC for compiling JavaScript/Typescript and will fall back to ...
Read more >
Why You Should Replace Babel with SWC in Next.js
If a custom Babel configuration file is present within your project, Next.js will automatically switch to your existing Babel configuration. This custom Babel ......
Read more >
How I change my compiler from BABEL to SWC in NextJS ...
Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled.
Read more >
Why you should use SWC (and not Babel) - LogRocket Blog
In this post, we'll cover the basics of transpilers and we'll compare Babel and SWC based on setup, execution, and speed.
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