Open tjx666 opened 5 months ago
So you are requesting a backport?
@kdy1 I recently upgrade my company project next from 12 to 14, next12 no this bug. The latest nextjs still has this bug but canary version had fixed it.
I don't know when the next will release the new version to fix it, But now there is no good way to fix it.
Yeap I understood. If we want to publish a new version that uses react@18 and recent SWC, we need to revert many commits before publishing and it should be a backport
I see that issue is related with swc loose setting, any way to config swc not to use losse
?
ref: https://github.com/swc-project/swc/issues/8830#issuecomment-2044727551
next-swc
does not use loose mode
@kdy1 I see there is a new 14.x update, but this issue is still not fixed
Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!
https://github.com/vercel/next.js/blob/v14.2.4/Cargo.lock#L5431
It's 0.90.30
and but the fix is 0.90.31
Link to the code that reproduces this issue
https://stackblitz.com/edit/nextjs-wzyqzn?file=app%2Fpage.tsx
To Reproduce
just open the stackblize online reproduce
Current vs. Expected behavior
expect
should compile correct
Provide environment information
Which area(s) are affected? (Select all that apply)
SWC
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
The latest canary version fix this issue, but I can find a good way to fix it now.
I want to use canary but it require react19. I try use yarn1 resolution to lock the next swc version, but yarn1 seems can't correctly deal with resolution with optionalDependencies:
So, I thing the best method way to fix this is the nextjs official release a new 14.x version.
I think the compile error is a serious error and cost me one day to locate it.
more context: