seancdavis
seancdavis
NNuxt
Created by seancdavis on 2/26/2025 in #❓・help
Hydration and caching issues on universal rendering page
Ah, so next step would be setting the headers with middleware? Or nitro config? What’s the next best thing to try?
23 replies
NNuxt
Created by seancdavis on 2/26/2025 in #❓・help
Hydration and caching issues on universal rendering page
@Philippe Serhal Makes sense that the headers for dynamic pages are not extracted to the static headers file. With what we discovered here, #1 and #2 (and maybe #3) from the original issue work as expected when using the default Nuxt build settings. When I build for Netlify, the issues arise. So it seems to me like there's something the Netlify preset is not doing properly in this transformation?
23 replies
NNuxt
Created by seancdavis on 2/26/2025 in #❓・help
Hydration and caching issues on universal rendering page
I was trying to show that by running with and without --preset netlify is that the behavior of the /polls/[id] route is different. Not sure exactly how Nuxt resolves what runs on server vs client. Can you share more about that, @manniL ?
23 replies
NNuxt
Created by seancdavis on 2/26/2025 in #❓・help
Hydration and caching issues on universal rendering page
Yes. I meant headers. That makes sense. The others should be generated at runtime and get moved to the serverless SSR function.
23 replies
NNuxt
Created by seancdavis on 2/26/2025 in #❓・help
Hydration and caching issues on universal rendering page
--- In addition, the Netlify adapter adds a _headers file and I noticed that it doesn't pick up the redirects mentioned in the page file (src/pages/polls/[id].vue). Going to check with the team on that one.
23 replies
NNuxt
Created by seancdavis on 2/26/2025 in #❓・help
Hydration and caching issues on universal rendering page
I then ran netlify build to see what the difference is, and I noticed that the adapter puts everything in dist, doing all the transformations in the process. Does that make it seem like #1 and #2 are Netlify adapter issues?
23 replies
NNuxt
Created by seancdavis on 2/26/2025 in #❓・help
Hydration and caching issues on universal rendering page
@TheAlexLichter Ahhh, okay. Progress... After yarn build, I can preview with node .output/server/index.mjs. I don't get a hydration error and I see content in the initial response:
<body>
<div id="__nuxt">
<div>
<div
class="bg-gradient-to-b from-slate-800 to-slate-950 min-h-screen text-white"
>
<header></header>
<main class="max-w-5xl mx-auto px-8 py-8">
<div class="mb-16 pt-12 text-center">
<h1 class="text-3xl sm:text-4xl font-bold tracking-tight">
Is this an example question?
</h1>
</div>
<!-- ... -->
</main>
<footer></footer>
</div>
</div>
</div>
<!-- ... -->
</body>
<body>
<div id="__nuxt">
<div>
<div
class="bg-gradient-to-b from-slate-800 to-slate-950 min-h-screen text-white"
>
<header></header>
<main class="max-w-5xl mx-auto px-8 py-8">
<div class="mb-16 pt-12 text-center">
<h1 class="text-3xl sm:text-4xl font-bold tracking-tight">
Is this an example question?
</h1>
</div>
<!-- ... -->
</main>
<footer></footer>
</div>
</div>
</div>
<!-- ... -->
</body>
23 replies