Skip to content

Commit

Permalink
Fix failing
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Sep 25, 2022
1 parent 186280e commit f84ce7f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/next/export/worker.ts
Expand Up @@ -29,7 +29,11 @@ import isError from '../lib/is-error'
import { addRequestMeta } from '../server/request-meta'
import { normalizeAppPath } from '../shared/lib/router/utils/app-paths'
import { REDIRECT_ERROR_CODE } from '../client/components/redirect'
import { DYNAMIC_ERROR_CODE } from '../client/components/hooks-server-context'
import type { DYNAMIC_ERROR_CODE } from '../client/components/hooks-server-context'

// hooks-server-context can't be imported because it will cause React.createServerContext to be called.
const DYNAMIC_ERROR_CODE_CONST: typeof DYNAMIC_ERROR_CODE =
'DYNAMIC_SERVER_USAGE'

loadRequireHook()
const envConfig = require('../shared/lib/runtime-config')
Expand Down Expand Up @@ -418,7 +422,7 @@ export default async function exportPage({
}
} catch (err: any) {
if (
err.digest !== DYNAMIC_ERROR_CODE &&
err.digest !== DYNAMIC_ERROR_CODE_CONST &&
err.digest !== REDIRECT_ERROR_CODE
) {
throw err
Expand Down

0 comments on commit f84ce7f

Please sign in to comment.