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.

`swcMinify: true` does not produce an usable build with v12.1.5

See original GitHub issue

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

 $ npx --no-install next info

    Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64
    Binaries:
      Node: 16.13.1
      npm: 8.1.2
      Yarn: 1.22.18
      pnpm: N/A
    Relevant packages:
      next: 12.1.5
      react: 17.0.2
      react-dom: 17.0.2

What browser are you using? (if relevant)

Not relevant

How are you deploying your application? (if relevant)

next start after a next build

Describe the Bug

Locally (running the application locally, in my IDE), everything looks good. Our tests are green as well. Only the PROD artefact is somehow rubbish.

When accessing the homepage, this is what we get in the console:

console

When clicking on one of the links displayed, this is what I get:

error_decoder

Expected Behavior

No error messages in the console, application is running properly and swcMinify is set to true, like it used to be for v12.1.0 (application was NOT working with the releases from v12.1.1 to v12.1.4).

The expected behavior could be achieved if I set swcMinify to false in the configuration file.

To Reproduce

Kindly follow instructions given in the README.md, Production-like local deployment.

More info on the problem could be found here and there.

Please, let me know if you have questions, or whether I should deeply investigate in a given direction, or if I can do anything here to help.

Thanks in advance for your time and investigation.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:42 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
kdy1commented, Apr 28, 2022

@VeronikaSergiyenko I think it will be fixed by https://github.com/vercel/next.js/pull/36535

React now uses google closure compiler as their minifier, and it triggered a bug of swc minifier. So I disabled the problematic pass for now and I’m working on a full fix for alias analyzer

2reactions
kdy1commented, Apr 22, 2022

@seanparmelee image

It will be fixed by https://github.com/vercel/next.js/pull/36351

(I used my own script to replace next-swc binary)

Read more comments on GitHub >

github_iconTop Results From Across the Web

nextjs v12 swcMinify set to true - Stack Overflow
Create a new file and name it .babelrc (if it does not exist) and add following content: { "presets": ["next/babel"] }.
Read more >
Reactivate `swcMinify` in 'next.config.js' - biomedit - GitLab
1.5 AND swcMinify : true . Because having the latest version is more important than having the latest features, we rollback swcMinify to...
Read more >
Use Next.js and Vercel to build a link-sharing app using ...
This is where you will create the React components that provide the core functionality of your application. Components are re-usable bits of code...
Read more >
Advanced Features: Next.js Compiler
js Compiler, written in Rust using SWC, allows Next.js to transform and minify your JavaScript code for production. This replaces Babel for individual...
Read more >
Deploy a Next.js site · Cloudflare Pages docs
In this guide, you will create a new Next.js application and deploy it using Cloudflare Pages. ​​ Consider if you need the Edge...
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