Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
chore(nuxt): add type for headers
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 19, 2022
1 parent d82d145 commit 35550ae
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/nuxt/src/core/runtime/nitro/error.ts
Expand Up @@ -45,9 +45,11 @@ export default <NitroErrorHandler> async function errorhandler (error: H3Error,

// HTML response (via SSR)
const isErrorPage = event.req.url?.startsWith('/__nuxt_error')
let html = !isErrorPage ? await $fetch(withQuery('/__nuxt_error', errorObject), {
headers: event.req.headers,
}).catch(() => null) : null
let html = !isErrorPage
? await $fetch(withQuery('/__nuxt_error', errorObject), {
headers: event.req.headers as HeadersInit
}).catch(() => null)
: null

// Fallback to static rendered error page
if (!html) {
Expand Down

0 comments on commit 35550ae

Please sign in to comment.