Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nuxt): respect baseUrl for client components within server components #25727

Merged
merged 11 commits into from
Mar 15, 2024
4 changes: 2 additions & 2 deletions packages/nuxt/src/app/components/nuxt-island.ts
Expand Up @@ -15,7 +15,7 @@ import { prerenderRoutes, useRequestEvent } from '../composables/ssr'
import { getFragmentHTML } from './utils'

// @ts-expect-error virtual file
import { remoteComponentIslands, selectiveClient } from '#build/nuxt.config.mjs'
import { appBaseURL, remoteComponentIslands, selectiveClient } from '#build/nuxt.config.mjs'

const pKey = '_islandPromises'
const SSR_UID_RE = /data-island-uid="([^"]*)"/
Expand All @@ -28,7 +28,7 @@ const getId = import.meta.client ? () => (id++).toString() : randomUUID

const components = import.meta.client ? new Map<string, Component>() : undefined

async function loadComponents (source = '/', paths: NuxtIslandResponse['components']) {
async function loadComponents (source = appBaseURL, paths: NuxtIslandResponse['components']) {
const promises = []
danielroe marked this conversation as resolved.
Show resolved Hide resolved

for (const component in paths) {
Expand Down