Felix
Felix
Explore posts from servers
NNuxt
Created by Felix on 2/26/2025 in #❓・help
Do I need to rerun the build command for `runtimeConfig` items to reflect changes?
@kapa.ai is it capable of transforming the env vars somehow? for example turn "true" into a JS boolean?
9 replies
NNuxt
Created by Felix on 2/5/2025 in #❓・help
How to show hydration mismatch errors causes in production builds?
@kapa.ai the mismatch is the first line of my laytout template without any conditional logic
15 replies
NNuxt
Created by Felix on 2/5/2025 in #❓・help
How to show hydration mismatch errors causes in production builds?
@kapa.ai i see
- rendered on server: <div class=​"h-full w-full z-10">​…​</div>​
- expected on client: Symbol(v-cmt)
- rendered on server: <div class=​"h-full w-full z-10">​…​</div>​
- expected on client: Symbol(v-cmt)
any idea what v-cmt is?
15 replies
NNuxt
Created by Felix on 2/5/2025 in #❓・help
How to show hydration mismatch errors causes in production builds?
any idea why i might only be seeing the error in production not in development?
15 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
and filed a bug. we'll see what comes of it.. https://github.com/nuxt/nuxt/issues/27909
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
ok. so idk if this is a bug in nuxt or not. but check this out:
const x = useAsyncData(
() => {
// this will NOT retain context in SSR call:
const fetch = $fetch;

// this retains context in SSR call:
// const fetch = useRequestFetch();

return fetch("/api/user");
},
{
immediate: true,
server: true,
watch: false,
},
);
const x = useAsyncData(
() => {
// this will NOT retain context in SSR call:
const fetch = $fetch;

// this retains context in SSR call:
// const fetch = useRequestFetch();

return fetch("/api/user");
},
{
immediate: true,
server: true,
watch: false,
},
);
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
I noticed that when I do a $fetch from my middleware/01.auth.global.ts middleware, the initial event context is retained! That is what I want. But why is this not happening for $fetch requests issued in page components is what I am trying to figure out. I cloned nuxt and will start digging...
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
Yes... So on the server why can't I get access to state established in the initial request object
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
For SSR pages
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
Yup but $fetch short-circuits and runs the code immediately on the server during the initial request. No client involved
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
Sorry if I come across rude but I don't understand how sth so simple can be made to be so difficult it can't be explained in one sentence . Kind of baffling. I'm surprised I also couldn't find answers on google. I love working with Nuxt overall. This is the first hol'on a minute moment. I'll give the video a watch tonight.
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
Which brings me back to why and how
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
What I am seeing is that for every $fetch the entire server/Middleware runs again on a fresh event object. Wouldn't getRequestEvent just return that?
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
Right. I'm taking about a single initial request. I made sure no other xhr requests show in the network tab. But event.context is always cleared and I don't know how I can access the initial request context
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
I really don't get it. So request flies in, route is matched, handler runs, some $fetch calls happen and since we are on the server a FN runs instead of a http req. In that FN all the context should be available no?
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
But if initial request binds to user a then for that request context how could it ever be user b?
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
What is cross state pollution?
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
Oh why is that
44 replies
NNuxt
Created by Felix on 6/27/2024 in #❓・help
How to keep state in SSR requests?
what i don't understand is it's just a function call; the context is already on the stack somehwere. is it not possible to somehow access this?
44 replies