Skip to content

Commit 1b3c6fe

Browse files
authored
fix static 404 & 500 in page router (#422)
* fix static 404 & 500 in page router * fix package.json * changeset
1 parent 61066fe commit 1b3c6fe

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

.changeset/curly-points-remember.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"open-next": patch
3+
---
4+
5+
Fix static 404 and 500 in page router

packages/open-next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"access": "public"
44
},
55
"name": "open-next",
6-
"version": "3.0.1-middleware-fix",
6+
"version": "3.0.1",
77
"bin": {
88
"open-next": "./dist/index.js"
99
},

packages/open-next/src/build/copyTracedFiles.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ See the docs for more information on how to bundle edge runtime functions.
9898
filesToCopy.set(f, f.replace(standaloneDir, outputDir));
9999
});
100100

101+
if (!existsSync(path.join(standaloneNextDir, `${fullFilePath}`))) {
102+
throw new Error(
103+
`This error should only happen for static 404 and 500 page from page router. Report this if that's not the case.,
104+
File ${fullFilePath} does not exist`,
105+
);
106+
}
107+
101108
filesToCopy.set(
102109
path.join(standaloneNextDir, fullFilePath),
103110
path.join(outputNextDir, fullFilePath),

0 commit comments

Comments
 (0)