Skip to content

Conversation

conico974
Copy link
Collaborator

@conico974 conico974 commented Mar 6, 2025

Should fix #432 #373 and #333

Next 15.2 introduced a change that create an AbortController https://github.com/vercel/next.js/pull/73975/files as a const outside of the request context.
This AbortController cause an issue while requiring app router pages that makes all these require return {} instead of the actual module in workerd. (see the comment for more detail)

It also replace the define of process.env.NEXT_MINIMAL inside of esbuild by a custom plugin that keep the renderHTML that can be used as a fallback by Next in case of error.

It also bump next version to 15.2.0 for the e2e examples

It's a draft for now, if workerd is not expected to throw for this case we could remove almost everything in this PR and just bump wrangler once fixed and merged

@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2025

⚠️ No Changeset found

Latest commit: 236c84d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 6, 2025

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/cloudflare@441

commit: b89abd9

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @conico974 for this fix.

I think the workerd error is expected - but we should fix this by not running next code at top level. It will also help with other issues (access process.env and getCloudflareContext() at top level). I hope to get to this next week. But it should not be a reason not to merge this PR.

I have added a few questions/comments after a quick review.

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome PR, it will be well appreciated by the community 🎉

I have added a few minor comments

@conico974 conico974 marked this pull request as ready for review March 9, 2025 11:37
@conico974 conico974 merged commit 4966779 into opennextjs:main Mar 9, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] next 15.2.0 breaks non static routes

2 participants