Maik
Maik
NNuxt
Created by Maik on 7/3/2023 in #❓・help
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
NNuxt
Created by Maik on 7/3/2023 in #❓・help
Errors migrating to server-only components
No description
9 replies
NNuxt
Created by Maik on 7/3/2023 in #❓・help
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
NNuxt
Created by Maik on 7/3/2023 in #❓・help
Errors migrating to server-only components
No description
9 replies
NNuxt
Created by Maik on 7/3/2023 in #❓・help
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
at createError (./node_modules/h3/dist/index.mjs:128:15)
at Object.handler (./.nuxt/dev/index.mjs:1710:15)
at Object.handler (./node_modules/h3/dist/index.mjs:1247:31)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async toNodeHandle (./node_modules/h3/dist/index.mjs:1322:7)
at async Object.ufetch [as localFetch] (./node_modules/unenv/runtime/fetch/index.mjs:9:17)
at async Object.errorhandler [as onError] (./.nuxt/dev/index.mjs:1333:30)
at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:1329:9)
at createError (./node_modules/h3/dist/index.mjs:128:15)
at Object.handler (./.nuxt/dev/index.mjs:1710:15)
at Object.handler (./node_modules/h3/dist/index.mjs:1247:31)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async toNodeHandle (./node_modules/h3/dist/index.mjs:1322:7)
at async Object.ufetch [as localFetch] (./node_modules/unenv/runtime/fetch/index.mjs:9:17)
at async Object.errorhandler [as onError] (./.nuxt/dev/index.mjs:1333:30)
at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:1329:9)
Stackblitz trace
at Module.createError (./node_modules/h3/dist/index.mjs:229:15)
at Object.eval [as handler] (./.nuxt/dev/index.mjs:1225:88)
at Object.eval [as handler] (./node_modules/h3/dist/index.mjs:1386:31)
at async toNodeHandle (./node_modules/h3/dist/index.mjs:1461:7)
at async Object.ufetch [as localFetch] (./node_modules/unenv/runtime/fetch/index.mjs:28:17)
at async Object.errorhandler [as onError] (./.nuxt/dev/index.mjs:850:30)
at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:1468:9)
at Module.createError (./node_modules/h3/dist/index.mjs:229:15)
at Object.eval [as handler] (./.nuxt/dev/index.mjs:1225:88)
at Object.eval [as handler] (./node_modules/h3/dist/index.mjs:1386:31)
at async toNodeHandle (./node_modules/h3/dist/index.mjs:1461:7)
at async Object.ufetch [as localFetch] (./node_modules/unenv/runtime/fetch/index.mjs:28:17)
at async Object.errorhandler [as onError] (./.nuxt/dev/index.mjs:850:30)
at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:1468:9)
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
NNuxt
Created by Maik on 7/3/2023 in #❓・help
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
NNuxt
Created by ABON on 6/12/2023 in #❓・help
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
NNuxt
Created by Sumit on 6/8/2023 in #❓・help
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
NNuxt
Created by Thomas Bnt on 3/30/2023 in #❓・help
Nuxt with Netlify functions
I have not tried this personally, so you might have to adjust the Netlify pipeline for the new output I suppose.
7 replies
NNuxt
Created by Thomas Bnt on 3/30/2023 in #❓・help
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
NNuxt
Created by Maik on 2/10/2023 in #❓・help
✨ Dynamic Sitemap with SSR without pre-render
Just browsed through the change logs. Looks amazing! Thanks for the continued development. I'll migrate as soon as I get the chance to 🙂
38 replies
NNuxt
Created by Maik on 2/10/2023 in #❓・help
✨ Dynamic Sitemap with SSR without pre-render
I'm sure you could do this using useFetch. I'm not sure why I didn't
38 replies
NNuxt
Created by Maik on 2/10/2023 in #❓・help
✨ Dynamic Sitemap with SSR without pre-render
I've created a server endpoint providing the data and then I used fetch in the arrow function that provides the routes
sitemap: {
cacheTime: 1,
routes: async () =>
(await fetch(useRuntimeConfig().siteUrl + "/api/routes")).json(),
defaults: {
priority: 1,
lastmod: new Date().toISOString(),
},
}
sitemap: {
cacheTime: 1,
routes: async () =>
(await fetch(useRuntimeConfig().siteUrl + "/api/routes")).json(),
defaults: {
priority: 1,
lastmod: new Date().toISOString(),
},
}
in my api-route file I can now use composable imports as usual (Gql Example:)
let data = await GqlGetAllPages();
let data = await GqlGetAllPages();
38 replies