Surreal
Surreal
NNuxt
Created by Surreal on 7/24/2024 in #❓・help
How to access buildId/build hash at runtime?
Oh interesting! Hadn't seen that hook before, will have to take a look - thanks!
3 replies
NNuxt
Created by Surreal on 5/22/2024 in #❓・help
How to get cookie value in SSR page?
Ah, nevermind. I realized that I had modified the nuxt config to make some pages not use SSR, some pages use SWR, etc., and that seems to be tied to the cause
6 replies
NNuxt
Created by Surreal on 5/22/2024 in #❓・help
How to get cookie value in SSR page?
P.S. I'm also not getting a "A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function." error, I'm getting a hydration mismatch between a server-side rendered undefined value, and a client-side rendered value from the cookie
6 replies
NNuxt
Created by Surreal on 5/22/2024 in #❓・help
How to get cookie value in SSR page?
e.g.,
<template>
<div>{{foobar}}</div>
</template>
<script lang="ts" setup>
const foobar = useCookie('foobar');
</script>
<template>
<div>{{foobar}}</div>
</template>
<script lang="ts" setup>
const foobar = useCookie('foobar');
</script>
also returns undefined in the SSR HTML, even when the cookie is defined
6 replies
NNuxt
Created by Surreal on 5/22/2024 in #❓・help
How to get cookie value in SSR page?
I use the Composition API exclusively (e.g., <script lang="ts" setup>...</script>) - shouldn't useCookie() have access to the Nuxt context in that scope?
6 replies