-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
Environment
Hello everybody, and first of all, thanks to all the team for your incredible job!
Here is the context:
I have a Nuxt app hosted on a root domain.
Some parts of the app are also accessible via subdomains (or even different domains).
To make assets and API calls work properly across all domains, I’ve set:
.env
BASE_URL="http://labaxxxxxxxxx.fr"
nuxt.config.ts
{
//...
app: {
cdnURL: process.env.BASE_URL
},
runtimeConfig: {
public: {
baseURL: process.env.BASE_URL,
}
},
experimental: {
componentIslands: 'local+remote'
}
//...
}
components/Markdown.server.vue
<Markdown :source="config.public.baseURL" />
Describe the bug
Everything works as expected on the root domain and even from subdomains for assets and API calls.
However, server components break when accessed from subdomains because their requests seem to be relative, not absolute.
✅ If the page is open from my root domain, everything works as excepted.
https://labaxxxxxxxxx.fr
But if I the page is open from a subdomain:
https://labrasive.labaxxxxxxxxx.fr
✅ The assets
or api
calls correctly targets the root domain, like this /band
:
❌ But the Markdown.server.vue
component call is broken because it doesn't target the root domain...
So is there an other way to set a BASE_URL
to Server Components, or is it a bug?
Thank you for your help!