diff --git a/packages/nuxt/src/core/runtime/nitro/error.ts b/packages/nuxt/src/core/runtime/nitro/error.ts index c58bb75fcd..c4d0a13612 100644 --- a/packages/nuxt/src/core/runtime/nitro/error.ts +++ b/packages/nuxt/src/core/runtime/nitro/error.ts @@ -55,7 +55,7 @@ export default async function errorhandler (error: H3Error, // HTML response (via SSR) const res = isRenderingError ? null : await useNitroApp().localFetch( - withQuery(joinURL(useRuntimeConfig().app.baseURL, '/__nuxt_error'), errorObject), + withQuery(joinURL(useRuntimeConfig(event).app.baseURL, '/__nuxt_error'), errorObject), { headers: { ...reqHeaders, 'x-nuxt-error': 'true' }, redirect: 'manual' diff --git a/packages/nuxt/src/core/runtime/nitro/paths.ts b/packages/nuxt/src/core/runtime/nitro/paths.ts index 0d2a027687..c76b5db2e1 100644 --- a/packages/nuxt/src/core/runtime/nitro/paths.ts +++ b/packages/nuxt/src/core/runtime/nitro/paths.ts @@ -2,10 +2,12 @@ import { joinURL } from 'ufo' import { useRuntimeConfig } from '#internal/nitro' export function baseURL (): string { + // TODO: support passing event to `useRuntimeConfig` return useRuntimeConfig().app.baseURL } export function buildAssetsDir (): string { + // TODO: support passing event to `useRuntimeConfig` return useRuntimeConfig().app.buildAssetsDir as string } @@ -14,6 +16,7 @@ export function buildAssetsURL (...path: string[]): string { } export function publicAssetsURL (...path: string[]): string { + // TODO: support passing event to `useRuntimeConfig` const app = useRuntimeConfig().app const publicBase = app.cdnURL as string || app.baseURL return path.length ? joinURL(publicBase, ...path) : publicBase diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts index 5fb732d0ab..344589e516 100644 --- a/packages/nuxt/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts @@ -158,7 +158,7 @@ const getSPARenderer = lazyCachedFunction(async () => { const result = await renderer.renderToString({}) const renderToString = (ssrContext: NuxtSSRContext) => { - const config = useRuntimeConfig() + const config = useRuntimeConfig(ssrContext.event) ssrContext.modules = ssrContext.modules || new Set() ssrContext!.payload = { _errors: {}, @@ -288,7 +288,7 @@ export default defineRenderHandler(async (event): Promise