Skip to content

replace NEXT_BUILD_ID with OPEN_NEXT_BUILD_ID#1208

Merged
vicb merged 9 commits intomainfrom
edmundhung/prefer-opennext-build-id
Apr 23, 2026
Merged

replace NEXT_BUILD_ID with OPEN_NEXT_BUILD_ID#1208
vicb merged 9 commits intomainfrom
edmundhung/prefer-opennext-build-id

Conversation

@edmundhung
Copy link
Copy Markdown
Contributor

This matches the changes in opennextjs/opennextjs-aws#1144 to deprecate the NEXT_BUILD_ID environment variable in favor of OPEN_NEXT_BUILD_ID.

@edmundhung edmundhung requested a review from james-elicx April 17, 2026 16:52
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 17, 2026

🦋 Changeset detected

Latest commit: 062514a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@opennextjs/cloudflare Patch

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 17, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@opennextjs/cloudflare@1208

commit: 062514a

Comment thread packages/cloudflare/src/cli/templates/init.ts Outdated
@alex-all3dp
Copy link
Copy Markdown
Contributor

@edmundhung @james-elicx is this the fix for opennextjs/opennextjs-aws#1136 and #1183 respectively? Does it require any changes on the user's side or will getDeploymentId() already return OPEN_NEXT_BUILD_ID once these changes are merged?

@vicb vicb changed the title feat: replace NEXT_BUILD_ID with OPEN_NEXT_BUILD_ID replace NEXT_BUILD_ID with OPEN_NEXT_BUILD_ID Apr 23, 2026
@james-elicx
Copy link
Copy Markdown
Collaborator

I believe some of the patches might need updating as well

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Apr 23, 2026

I believe some of the patches might need updating as well

Do you have anything specific in mind ?

FYI I have just created a PR to aws and have further local commits that I will push after AWS is released but no update to patches yet.

Thanks

@james-elicx
Copy link
Copy Markdown
Collaborator

I believe some of the patches might need updating as well

Do you have anything specific in mind ?

FYI I have just created a PR to aws and have further local commits that I will push after AWS is released but no update to patches yet.

Thanks

I'm assuming these parts would want to reference the new variable:

if ($PATH.endsWith(".next/BUILD_ID")) {
return process.env.NEXT_BUILD_ID;
}

getBuildId($$$PARAMS) {
return process.env.NEXT_BUILD_ID;
}

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Apr 23, 2026

I believe some of the patches might need updating as well

Do you have anything specific in mind ?
FYI I have just created a PR to aws and have further local commits that I will push after AWS is released but no update to patches yet.
Thanks

I'm assuming these parts would want to reference the new variable:

if ($PATH.endsWith(".next/BUILD_ID")) {
return process.env.NEXT_BUILD_ID;
}

getBuildId($$$PARAMS) {
return process.env.NEXT_BUILD_ID;
}

I believe not, this is Next code and behavior should not be altered.
@conico974 do you confirm?

@vicb vicb requested review from conico974 and james-elicx April 23, 2026 10:39
@vicb vicb changed the title replace NEXT_BUILD_ID with OPEN_NEXT_BUILD_ID [BLOCKED on AWS release] replace NEXT_BUILD_ID with OPEN_NEXT_BUILD_ID Apr 23, 2026
@vicb
Copy link
Copy Markdown
Contributor

vicb commented Apr 23, 2026

@conico974 @edmundhung @james-elicx Could you please take a quick look at the PR. IMO it's good to go (I'll release AWS and use that after the changes here are validated).

@conico974
Copy link
Copy Markdown
Collaborator

I believe some of the patches might need updating as well

Do you have anything specific in mind ?
FYI I have just created a PR to aws and have further local commits that I will push after AWS is released but no update to patches yet.
Thanks

I'm assuming these parts would want to reference the new variable:

if ($PATH.endsWith(".next/BUILD_ID")) {
return process.env.NEXT_BUILD_ID;
}

getBuildId($$$PARAMS) {
return process.env.NEXT_BUILD_ID;
}

I believe not, this is Next code and behavior should not be altered. @conico974 do you confirm?

Yeah we don't want to modify that, that's also why I named the new env OPEN_NEXT_BUILD_ID instead

Comment thread packages/cloudflare/package.json Outdated
@vicb vicb changed the title [BLOCKED on AWS release] replace NEXT_BUILD_ID with OPEN_NEXT_BUILD_ID replace NEXT_BUILD_ID with OPEN_NEXT_BUILD_ID Apr 23, 2026
@vicb
Copy link
Copy Markdown
Contributor

vicb commented Apr 23, 2026

Thanks for the reviews @conico974 and @james-elicx !

Copy link
Copy Markdown
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 for the PR @edmundhung !

@vicb vicb merged commit 2c5b472 into main Apr 23, 2026
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.

5 participants