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

chore(nuxt): add type for headers #8326

Merged
merged 1 commit into from Oct 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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