This repository was archived by the owner on May 10, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ describe("getServerSideProps", () => {
210
210
cy . state ( "document" ) . write ( response . body ) ;
211
211
} ) ;
212
212
213
- // cy.get("h2").should("contain", "This page could not be found.");
213
+ cy . get ( "h2" ) . should ( "contain" , "This page could not be found." ) ;
214
214
} ) ;
215
215
216
216
it ( "loads TV show with one param" , ( ) => {
@@ -328,7 +328,7 @@ describe("getStaticProps", () => {
328
328
cy . state ( "document" ) . write ( response . body ) ;
329
329
} ) ;
330
330
331
- // cy.get("h2").should("contain", "This page could not be found.");
331
+ cy . get ( "h2" ) . should ( "contain" , "This page could not be found." ) ;
332
332
} ) ;
333
333
} ) ;
334
334
@@ -704,6 +704,6 @@ describe("404 page", () => {
704
704
cy . state ( "document" ) . write ( response . body ) ;
705
705
} ) ;
706
706
707
- // cy.get("h2").should("contain", "This page could not be found.");
707
+ cy . get ( "h2" ) . should ( "contain" , "This page could not be found." ) ;
708
708
} ) ;
709
709
} ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const { join, relative } = require("path");
2
2
const { copySync } = require ( "fs-extra" ) ;
3
3
const { logTitle, logItem } = require ( "../../helpers/logger" ) ;
4
4
const { NEXT_DIST_DIR } = require ( "../../config" ) ;
5
+ const nextConfig = require ( "../../helpers/getNextConfig" ) ( ) ;
5
6
const setupStaticFileForPage = require ( "../../helpers/setupStaticFileForPage" ) ;
6
7
const pages = require ( "./pages" ) ;
7
8
@@ -14,6 +15,17 @@ const setup = (publishPath) => {
14
15
pages . forEach ( ( { filePath } ) => {
15
16
logItem ( filePath ) ;
16
17
18
+ // HACK: If i18n, Next internals expect a 404.html at the top level of the publish directory
19
+ // TO-DO: investigate framework and why this isn't an issue on Vercel and only certain routes
20
+ if ( nextConfig . i18n ) {
21
+ if ( filePath === `pages/${ nextConfig . i18n . defaultLocale } /404.html` ) {
22
+ copySync (
23
+ join ( NEXT_DIST_DIR , "serverless" , filePath ) ,
24
+ join ( publishPath , "404.html" )
25
+ ) ;
26
+ }
27
+ }
28
+
17
29
// The path to the file, relative to the pages directory
18
30
const relativePath = relative ( "pages" , filePath ) ;
19
31
setupStaticFileForPage ( { inputPath : relativePath , publishPath } ) ;
You can’t perform that action at this time.
0 commit comments