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

SWC + next.js + Node.js v22.7 #54532

Closed
RaenonX opened this issue Aug 24, 2024 · 10 comments
Closed

SWC + next.js + Node.js v22.7 #54532

RaenonX opened this issue Aug 24, 2024 · 10 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@RaenonX
Copy link

RaenonX commented Aug 24, 2024

Version

v22.7

Platform

Microsoft Windows NT 10.0.22631.0 x64

Subsystem

No response

What steps will reproduce the bug?

  1. Create a next.js app
  2. Run next dev
  3. (Failed)

How often does it reproduce? Is there a required condition?

Deterministic (everytime).

What is the expected behavior? Why is that the expected behavior?

No error.

What do you see instead?

For others: vercel/next.js#69150 (the actual repo that I realized it's 22.7 release breaking it).

For myself, my CI starts deterministically failing on Aug. 21 (22.7 release date), and the error (One of the failed CI) is always the same of saying "invalid unicode code point."

Additional information

No response

@RedYetiDev
Copy link
Member

Hi! Could you provide a minimal reproduction?

@RedYetiDev RedYetiDev added regression Issues related to regressions. v22.x v22.x Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch. labels Aug 24, 2024
@ViggoV
Copy link

ViggoV commented Aug 26, 2024

Hi! Could you provide a minimal reproduction?

There's also a few replicable examples here: vercel/next.js#69263

@RedYetiDev
Copy link
Member

v22.8.0 is releasing soon with patches for a few buffer issues, so if this is related, that may fix it.

@bernaferrari
Copy link

This completely breaks NextJS for me. I think you should check if 22.8 fixes it, because it is a fairly big problem.

@RedYetiDev
Copy link
Member

This completely breaks NextJS for me. I think you should check if 22.8 fixes it, because it is a fairly big problem.

If you'd like to test the buffer patches, their PRs are #54526, #54524, and #54565

@RedYetiDev RedYetiDev added the buffer Issues and PRs related to the buffer subsystem. label Aug 26, 2024
@RedYetiDev
Copy link
Member

RedYetiDev commented Aug 26, 2024

FWIW, Regarding whether this is a buffer issue or not, I've confirmed it is. looking at the offending code,
It's calling:

bindings.minify(toBuffer(src), toBuffer(options ?? {}));

Reference A: https://www.npmjs.com/package/next?activeTab=code (Line 814)
Reference B: https://github.com/swc-project/swc/blob/d068a63ba218a0884de5cbd10764f3f6f652bc5c/packages/core/src/index.ts#L66

@RedYetiDev
Copy link
Member

RedYetiDev commented Aug 26, 2024

I think this is a duplicate of #54521, as the buffer isn't returning what it is expected to, which is what that issue is discussing. WDYT @ronag

@RaenonX
Copy link
Author

RaenonX commented Aug 27, 2024

Sorry was enjoying my weekend, but good to know that it's possibly fix at v22.8. I'll wait and see if v22.8 fixes this! (I assume no repro is needed?)

mutaphysis added a commit to sozialhelden/wheelmap-frontend that referenced this issue Aug 27, 2024
mutaphysis added a commit to sozialhelden/wheelmap-frontend that referenced this issue Aug 27, 2024
@RedYetiDev RedYetiDev closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2024
@RedYetiDev RedYetiDev added duplicate Issues and PRs that are duplicates of other issues or PRs. and removed buffer Issues and PRs related to the buffer subsystem. regression Issues related to regressions. v22.x v22.x Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch. labels Aug 29, 2024
@lightify97
Copy link

lightify97 commented Sep 15, 2024

Sorry was enjoying my weekend, but good to know that it's possibly fix at v22.8. I'll wait and see if v22.8 fixes this! (I assume no repro is needed?)

I just experienced this on v22.8.0 (Next v14.2.11). Downgrading to v20.17.0 solved the issue for me.

@RaenonX
Copy link
Author

RaenonX commented Sep 15, 2024

Sorry was enjoying my weekend, but good to know that it's possibly fix at v22.8. I'll wait and see if v22.8 fixes this! (I assume no repro is needed?)

I just experienced this on v22.8.0 (Next v14.2.11). Downgrading to v20.17.0 solved the issue for me.

22.8 should work (at least for me), the CI I am running is using 22.8 and it never failed because of this error, maybe check node version using command first?

https://dev.azure.com/RaenonX/RaenonX/_build/results?buildId=9733&view=logs&j=dd80c5cf-c1e0-5ab3-fd96-ef8a744d5654&t=3e86df9c-ea95-5693-1b8c-fd416a80634d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

6 participants
@bernaferrari @ViggoV @lightify97 @RaenonX @RedYetiDev and others