[next] skip building pages router entries when not present#13704
Merged
[next] skip building pages router entries when not present#13704
Conversation
🦋 Changeset detectedLatest commit: b857d29 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
61fda46 to
5cf044b
Compare
df15816 to
a1edc82
Compare
a1edc82 to
1592238
Compare
ztanner
reviewed
Aug 11, 2025
ijjk
reviewed
Aug 12, 2025
7653fa8 to
b92c560
Compare
huozhi
commented
Aug 15, 2025
ijjk
approved these changes
Aug 15, 2025
Merged
ijjk
pushed a commit
that referenced
this pull request
Aug 18, 2025
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## vercel@46.0.2 ### Patch Changes - feat(cli): add SSO re-authorization support to --future ([#13771](#13771)) - Return the correct exit code in the Vercel command ([#13780](#13780)) - Updated dependencies \[[`fcf7791f1dae2967c09c09b78aedf00be5d25303`](fcf7791), [`b9e399c69ebeb71d9150e8aa994294b0c2be8c9f`](b9e399c)]: - @vercel/next@4.11.3 ## @vercel/next@4.11.3 ### Patch Changes - Handle building for app router without internal pages entries ([#13704](#13704)) - Add action metadata routes ([#13775](#13775)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a dependency of the Next.js PR (vercel/next.js#82444). Since we're not output Pages Router entries when only only App Router presents in that PR, we need to skip the Pages internal entries
/_app,/_documentand/_errorbuilding in next builder.Currently next builder always emit the internal entries. For backword compatiability, we need to always try to emit the entries for the new Next.js with that change, and for previous versions we still emit Pages Router internal entries.
When we stop emitting the internal entries,
lambdas[page]will be undefined, then readinglambdas[page].fsPathand the rest gona be broken on those internal entries. So we add optional check for accessing state of each page.So we filterout the non-existed
internalPagesbylambdaPageswhich is the actual output from next.js, hence the rest logic will be safe. It's creating lambdas based on what nextjs actually emitted.Verification with Next.js
Manually tested with the 2 deployment failing from nextjs side, it works well.
Using a custom build with this change and test on Next.js with test-deploy jobs:
https://github.com/vercel/next.js/actions/runs/16992428463/job/48176499037?pr=82444