Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__NEXT_MANGLING_DEBUG resp. --no-mangling do not work with swcMinify: true (per next config) #50208

Closed
1 task done
dbo opened this issue May 23, 2023 · 3 comments · Fixed by #75921
Closed
1 task done
Labels
bug Issue was opened via the bug report template. locked SWC Related to minification/transpilation in Next.js.

Comments

@dbo
Copy link
Contributor

dbo commented May 23, 2023

Verify canary release

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

Provide environment information

Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 22.5.0: Mon Apr 24 20:51:50 PDT 2023; root:xnu-8796.121.2~5/RELEASE_X86_64
    Binaries:
      Node: 18.15.0
      npm: 9.5.0
      Yarn: 1.22.19
      pnpm: N/A
    Relevant packages:
      next: 13.4.4-canary.2
      eslint-config-next: 13.4.3
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.0.4

Which area(s) of Next.js are affected? (leave empty if unsure)

SWC minifier (swcMinify: true)

Link to the code that reproduces this issue or a replay of the bug

https://github.com/vercel/next.js/tree/canary/examples/basic-export

To Reproduce

  1. Create plain boilerplate via yarn create next-app
  2. Run yarn next build --no-mangling
  3. Inspect output in .next
  4. Modify next.config.js to use swcMinify: true
  5. Run yarn next build --no-mangling
  6. Inspect output in .next, see e.g. class names are preserved.

Describe the Bug

Currently disabling terser mangling (__NEXT_MANGLING_DEBUG resp. --no-mangling) do not work with swcMinify: true (i.e. default).

Expected Behavior

__NEXT_MANGLING_DEBUG resp. --no-mangling should work regardless of swcMinify.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@dbo dbo added the bug Issue was opened via the bug report template. label May 23, 2023
SukkaW added a commit to SukkaW/next.js that referenced this issue Jul 29, 2023
@SukkaW
Copy link
Contributor

SukkaW commented Jul 29, 2023

@dbo Sorry for the long delay, and I finally figure the cause of the issue. I have opened the #53330 to fix this.

@balazsorban44 balazsorban44 added SWC Related to minification/transpilation in Next.js. and removed area: SWC Minify labels Apr 17, 2024
@ddadaal

This comment has been minimized.

ddadaal added a commit to PKUHPC/OpenSCOW that referenced this issue Apr 23, 2024
启用AI项目的服务器端代码优化serverMinification,只使用`--no-mangling`和`swcMinify:
false`来关闭name
mangling以解决[这个问题](https://github.com/mikro-orm/mikro-orm/issues/5487)。理论上来说应该只要`--no-mangling`就行,但是应该还是next的bugvercel/next.js#50208 ),必须还要同时设置`swcMinify:
false`才可以。
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked SWC Related to minification/transpilation in Next.js.
Projects
None yet
4 participants