-
Notifications
You must be signed in to change notification settings - Fork 921
Open
Labels
bugSomething isn't workingSomething isn't workingtriageAwaiting initial review and prioritizationAwaiting initial review and prioritizationv4#4488#4488
Description
Is this bug related to Nuxt or Vue?
Vue (Inertia in particular)
Package
v4.x
Version
v4.0.1
Reproduction
The UI library is currently incompatible with the Inertia SSR server: https://inertiajs.com/server-side-rendering.
The compiled SSR file tries to alter the document.head which is not possible in SSR:
if (nuxtApp.isHydrating && !nuxtApp.payload.serverRendered) {
const style = document.createElement("style");
style.innerHTML = root.value;
style.setAttribute("data-nuxt-ui-colors", "");
document.head.appendChild(style);
headData.script = [{
innerHTML: "document.head.removeChild(document.querySelector('[data-nuxt-ui-colors]'))"
}];
}It is currently trying to do that as the payload.serverRendered is set to false in the useNuxtApp() function in the compiled file:
function useNuxtApp() {
return {
isHydrating: true,
payload: { serverRendered: false },
hooks,
hook: hooks.hook
};
}Changing the value manually to true seems to fix the issue, so I believe it is just a matter of detecting if it is being compiled to Inertia SSR or not.
ceigey
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriageAwaiting initial review and prioritizationAwaiting initial review and prioritizationv4#4488#4488