vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.56k stars 26.82k forks source link

Minification: wrong inline of compression in next js 14 #62726

Open rishabh3112 opened 7 months ago

rishabh3112 commented 7 months ago

Link to the code that reproduces this issue

Following code minifies incorrectly in production as shown here: reproduction example

To Reproduce

Similar issue in swc project: https://github.com/swc-project/swc/issues/8161

This is fixed in swc version 1.3.95 (https://github.com/swc-project/swc/blob/main/CHANGELOG.md#1395---2023-10-24), but is not included with next js

Current vs. Expected behavior

Current behaviour: SWC playground link

Expected behaviour: SWC playground link

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
Binaries:
  Node: 18.14.2
  npm: 9.5.0
  Yarn: 3.2.4
  pnpm: N/A
Relevant Packages:
  next: 14.0.1
  eslint-config-next: 14.0.1
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 4.9.5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

SWC minifier (swcMinify: true)

Which stage(s) are affected? (Select all that apply)

Other (Deployed)

Additional context

No response

OlegLustenko commented 7 months ago

@rishabh3112 Current and expected links lead to the same page

rishabh3112 commented 7 months ago

@OlegLustenko updated, thanks.