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

Potential incompatibility with next@4.2.12 #1076

Closed
Xunnamius opened this issue Sep 18, 2024 · 7 comments
Closed

Potential incompatibility with next@4.2.12 #1076

Xunnamius opened this issue Sep 18, 2024 · 7 comments
Labels
bug Something isn't working released

Comments

@Xunnamius
Copy link
Owner

Xunnamius commented Sep 18, 2024

The problem

Looks like the internals have shifted with this version of Next. Investigating.

Semi-related: looks like there might be a bug in https://github.com/vercel/next.js/blame/ac4a1c6730672bf2783414e51f64b49519ddffdb/packages/next/src/server/route-modules/app-route/module.ts#L520-L521 (is one of those POSTs supposed to be a PUT?)

UPDATE: narrowed down the issue to isStaticGeneration being set to true in the AsyncLocalStorage instance context triggering the problematic static generation logic. Looks like some API routes are gonna get statically generated now.

Fix incoming.

Reproduction steps

See failing actions.

@Xunnamius Xunnamius added the bug Something isn't working label Sep 18, 2024
@lordphnx
Copy link
Contributor

We are experiencing the following, is it related?

Cannot read properties of undefined (reading 'multiZoneDraftMode')
        at multiZoneDraftMode ([redacted]/node_modules/next/src/server/api-utils/node/api-resolver.ts:350:60)
        at IncomingMessage.getter [as previewData] ([redacted]/node_modules/next/src/server/api-utils/index.ts:209:21)

@Xunnamius
Copy link
Owner Author

@lordphnx Indeed it is. And thank you for #1077 on the Pages router side! I'll get that merged in after I've had a coffee. I'm investigating the app router side now, hopefully the fix is as straightforward.

@lordphnx
Copy link
Contributor

@Xunnamius are there any steps you need from me to get this into a version we can use?

The "bug" is currently inhibiting our CI pipelines, so we would be very happy to use this small fix.

@Xunnamius
Copy link
Owner Author

I was going to push both Pages and App router fixes in the same release, but I can cut a patch release with just this fix 👍🏿

@lordphnx
Copy link
Contributor

lordphnx commented Sep 18, 2024

I have a room full of developers here who would greatly appreciate that ❤️

@Xunnamius
Copy link
Owner Author

Xunnamius commented Sep 18, 2024

ntarh@4.0.10 is live

Xunnamius added a commit that referenced this issue Sep 18, 2024
### [4.0.11](v4.0.10...v4.0.11) (2024-09-18)

#### 🪄 Fixes

* **src:** stop Next.js from attempting to statically generate routes under test ([a461e81](a461e81)) <sup>closes [#1076](https://github.com/Xunnamius/next-test-api-route-handler/issues/1076)</sup>
@Xunnamius
Copy link
Owner Author

🎉 This issue has been resolved in version 4.0.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants