Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1f5abf4
fix(pages): preserve missing page props on errors
james-elicx Jul 8, 2026
36ed1ff
fix(pages): complete default error props contract
james-elicx Jul 8, 2026
8635f98
fix(pages): match default error component contract
james-elicx Jul 8, 2026
d863fe3
fix(pages): complete next error parity
james-elicx Jul 8, 2026
438a17a
fix(pages): make next error subclassable
james-elicx Jul 8, 2026
de064d8
fix(pages): align next error context types
james-elicx Jul 8, 2026
af70356
fix(pages): isolate error context types
james-elicx Jul 8, 2026
4ea7045
test(pages): cover default error production hydration
james-elicx Jul 8, 2026
6002fcf
test(pages): cover default error hydration in dev
james-elicx Jul 8, 2026
76fbeb9
fix(pages): hydrate dev error responses
james-elicx Jul 8, 2026
02abf13
fix(pages): set dev error router context
james-elicx Jul 8, 2026
5473cf5
fix(pages): isolate dev error router state
james-elicx Jul 8, 2026
b786df4
fix(pages): align dev error router hydration
james-elicx Jul 8, 2026
02ce049
fix(pages): keep error router ready during hydration
james-elicx Jul 8, 2026
4234482
fix(pages): clean up error fallback handling
james-elicx Jul 8, 2026
8876103
Merge remote-tracking branch 'origin/main' into codex/fix-pages-no-pa…
james-elicx Jul 9, 2026
67d074f
fix(pages): load custom error page on navigation
james-elicx Jul 9, 2026
375d9d8
Merge remote-tracking branch 'origin/main' into codex/fix-pages-no-pa…
james-elicx Jul 9, 2026
79074bf
refactor(pages): share dev hydration entry
james-elicx Jul 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/vinext/src/entries/pages-client-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export async function generateClientEntry(
const apiRoutes = await apiRouter(pagesDir, nextConfig?.pageExtensions, fileMatcher);

const appFilePath = findFileWithExts(pagesDir, "_app", fileMatcher);
const errorFilePath = findFileWithExts(pagesDir, "_error", fileMatcher);
const hasApp = appFilePath !== null;
const appPrefetchRoutes = options.appPrefetchRoutes ?? [];
const pagesPrefetchRoutes: VinextPagesLinkPrefetchRoute[] = [
Expand Down Expand Up @@ -102,6 +103,11 @@ export async function generateClientEntry(
// lgtm[js/bad-code-sanitization]
return ` ${JSON.stringify(nextFormatPattern)}: () => import(${JSON.stringify(absPath)})`;
});
loaderEntries.push(
errorFilePath !== null
? ` "/_error": () => import(${JSON.stringify(errorFilePath)})`
Comment thread
james-elicx marked this conversation as resolved.
Dismissed
: ' "/_error": () => import("next/error")',
);

const appFileBase = appFilePath ?? undefined;

Expand Down
20 changes: 9 additions & 11 deletions packages/vinext/src/entries/pages-server-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export async function generateServerEntry(
const errorImportCode =
errorFilePath !== null
? `import * as ErrorPageModule from ${JSON.stringify(errorFilePath)};`
: `const ErrorPageModule = null;`;
: `import * as ErrorPageModule from "next/error";`;

// Serialize i18n config for embedding in the server entry
const i18nConfigJson = nextConfig?.i18n
Expand Down Expand Up @@ -301,16 +301,14 @@ export const pageRoutes = [
${pageRouteEntries.join(",\n")}
];
const _pageRouteTrie = _buildRouteTrie(pageRoutes);
const _errorPageRoute = ErrorPageModule
? {
pattern: "/_error",
patternParts: ["_error"],
isDynamic: false,
params: [],
module: ErrorPageModule,
filePath: ${errorAssetPathJson},
}
: null;
const _errorPageRoute = {
pattern: "/_error",
patternParts: ["_error"],
isDynamic: false,
params: [],
module: ErrorPageModule,
filePath: ${errorAssetPathJson},
};

const apiRoutes = [
${apiRouteEntries.join(",\n")}
Expand Down
Loading
Loading