Maik
Errors migrating to server-only components
Furthermore some setups seem to work in the blitzstack and some wont. In general Islands might not be easy to migrate to right now when the stack is complex already.
I suspect it being some kind of "because the island gets conditionally rendered by the "normal" ContentPage component in my stack" Issue...
I guess when Nuxt gets CSC and SSC mixed hierachies that might solve. But for now I find it hard to understand:
A. How Islands render and when/how they are fetched.
B. How Islands interact with non island components, slots and conditional rendering.
C. How existing modules and plugins could alter my local stack experience in difference to the stackblitz reproduction
9 replies
Errors migrating to server-only components
I first thought its about the serialized prop size, but on blitzstack I can get 4000 paragraphs of lorem rendered by the island.
Since the Text component is rendered inside the non-island content component, it just gets rendered and hydrated as usual. If I change the content component to be a server component too, I get the expected behaviour.
9 replies
Errors migrating to server-only components
https://stackblitz.com/edit/nuxt-starter-nagevb?file=components%2Ftext.vue
I got it.
If you rename text.server.vue to text.vue or text.client.vue it will error out 400 and print [Vue warn]: Component NuxtIsland is missing template or render function.
This might be a renaming issue. It fixes on blitzstack after restarting the dev server. On my local machiene though, I cannot get it to work even after npx nuxi clean'ing the project. One difference I cant seem to reproduce is the stacktrace. My local trace Stackblitz trace I hope this helps. I'm still trying to find a reproduction that shows the exact behaviour of my Issue, since Blitzstack's error resolves and mine doesnt...
This might be a renaming issue. It fixes on blitzstack after restarting the dev server. On my local machiene though, I cannot get it to work even after npx nuxi clean'ing the project. One difference I cant seem to reproduce is the stacktrace. My local trace Stackblitz trace I hope this helps. I'm still trying to find a reproduction that shows the exact behaviour of my Issue, since Blitzstack's error resolves and mine doesnt...
9 replies
Errors migrating to server-only components
Im trying to reporduce right now. Minmal reproduction worked getting a server component to render inside a page, that uses a layout that has a clientside component. (similar to how it is in my project)
Im slowly adding config and modules right now to find the culprit. Ill let you know if I succeed.
9 replies
Question about srr
I dont know what you try to archieve exactly but take a look at this https://nuxt.com/docs/guide/directory-structure/components#clientonly-component
3 replies
State Management
To handle state you can use named useState (built-in) or a state manage like Pinia.
Basically like you would in a vue project.
useState only persists in the client but in some cases it can get it's initial value from the server.
Since I guess Cookies, Local- and Session storage don't do the trick.
https://github.com/sidebase/nuxt-session
This might be what you are looking for.
An alternative would be using a session token and building your own server routes to handle the session management.
2 replies
Nuxt with Netlify functions
I think you can set the build preset to node-server. I guess if it isn't explicitly set Netlify will use the netlify-edge or netlify-builder
https://nuxt.com/docs/getting-started/deployment#presets
7 replies