Skip to content

Commit

Permalink
chore: handles PR remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
feugy committed Dec 22, 2022
1 parent 2840c49 commit c357a02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions packages/next/build/analysis/get-page-static-info.ts
Expand Up @@ -317,8 +317,9 @@ export async function getPageStaticInfo(params: {
typeof resolvedRuntime !== 'string'
? `The \`runtime\` config must be a string. Please leave it empty or choose one of: ${options}`
: `Provided runtime "${resolvedRuntime}" is not supported. Please leave it empty or choose one of: ${options}`
Log.error(message)
if (!isDev) {
if (isDev) {
Log.error(message)
} else {
throw new Error(message)
}
}
Expand All @@ -342,8 +343,9 @@ export async function getPageStaticInfo(params: {
!isAPIRoute(page.replace(/^\/pages\//, '/'))
) {
const message = `Page ${page} provided runtime 'edge', the edge runtime for rendering is currently experimental. Use runtime 'experimental-edge' instead.`
Log.error(message)
if (!isDev) {
if (isDev) {
Log.error(message)
} else {
throw new Error(message)
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/edge-configurable-runtime/index.test.ts
Expand Up @@ -122,7 +122,7 @@ describe('Configurable runtime for pages and API routes', () => {
expect(output.code).toBe(1)
expect(output.stderr).not.toContain(`Build failed`)
expect(output.stderr).toContain(
`error - Page / provided runtime 'edge', the edge runtime for rendering is currently experimental. Use runtime 'experimental-edge' instead.`
`Error: Page / provided runtime 'edge', the edge runtime for rendering is currently experimental. Use runtime 'experimental-edge' instead.`
)
})
})
Expand Down

0 comments on commit c357a02

Please sign in to comment.