-
Notifications
You must be signed in to change notification settings - Fork 26k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(standalone): fixed
output: "standalone"
crashing build when the…
…re is no `app/` page (#51993) ### What? This PR fixes build crashing when `output: 'standalone'` and `experimental.appDir` is enabled but there is no app pages. ### How? It does that by checking whether `.next/server/app` exists before copying the folder to `.next/standalone/...` Closes #51828 Fixes #44442 Fixes #44120
- Loading branch information
Showing
5 changed files
with
84 additions
and
60 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default function Root({ children }) { | ||
return ( | ||
<html> | ||
<head></head> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
test/production/standalone-mode/no-app-routes/index.test.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { createNextDescribe } from 'e2e-utils' | ||
|
||
createNextDescribe( | ||
'standalone mode - no app routes', | ||
{ | ||
files: __dirname, | ||
}, | ||
({ next }) => { | ||
it('should handle pages rendering correctly', async () => { | ||
const browser = await next.browser('/hello') | ||
expect(await browser.elementByCss('#index').text()).toBe('index-page') | ||
}) | ||
} | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
output: 'standalone', | ||
} |
Oops, something went wrong.