-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Next.js 13 custom server + SSR + Hydration #4389
Comments
👋 took the liberty of forking the repro - https://github.com/johnjenkins/nextjs13-ssr-hydration - applied #2938. Seems to be fixed. I'd love to get that PR merged one day. |
We have full SSR and Stencil/NextJS running by using JohnJenkins 2.23 build with the integrated PR (for most of the slot problems) and we hydrate Stencil before NextJS, by putting This requires you to provide the component library via an asset in the server.js. (see https://github.com/mayerraphael/stencil-ssr-bug/blob/main/my-app/server.js#LL23C1-L23C91) Also be sure to set Here is a link to a recent repo of mine: https://github.com/mayerraphael/stencil-ssr-bug/blob/main/my-app/pages/_document.tsx (it is missing the body fix, as this caused the problems we wanted to show with this repo) https://nextjs.org/docs/pages/building-your-application/optimizing/scripts#strategy The PR @johnjenkins named is so vital for us. SSR is so buggy ATM without this PR that it is just straight unusable. |
Can any of you help me? I have my company’s design system that is using the stencil and they work perfectly in the next version that uses the pages/ folder, but trying to use it in the app/ folder in the new 13.4 version the components are loaded but the style is not If I set the
|
I am facing the same issue @gabrielleacuba . Any updates on this since you posted it? |
@gabrielleacuba & @TheNinza - not really to do with SSR, but your problems are due to an issue with Nextjs (not Stencil) in that it removes any 3rd party tag injected into the head (e.g. analytics etc) vercel/next.js#11012 It was fixed in April via an experimental flag: vercel/next.js#47938. Just add:
To you next.config |
@mayerraphael in case you weren't aware - the PR has been picked up in a dev version of Stencil (3.3.0-dev.1685496483.a311f36). |
closing in favor of #5831 |
Prerequisites
Stencil Version
3.2.2
Current Behavior
This is a extension from the Stencil Discord thread, where a issue was asked to log an issue that can replicate the issues my team is seeing while trying to use NextJS 13.4+ with Stencil 3.3.2 and hydrate renderToString with a custom server to provide the server with a hydrated document.
Example screenshot
Expected Behavior
I expect the server and client to be in sync from an initial render, with the expectation that fetching and interactive elements won't be available
System Info
Steps to Reproduce
The repo linked is a NX/Lerna repo
npm install
npx lerna bootstrap
npx nx run @matt/stencil-components:build
npx nx run @matt/react-library:build
npx nx run next-13-demo:dev
-Warning with extra attribute
npx nx run next-13-demo:dev:custom
-Hydration Mismatch
Error - BreakingCode Reproduction URL
https://github.com/mbulfair/nextjs13-ssr-hydration
Additional Information
Discord Thread - https://discord.com/channels/520266681499779082/1107698585002319883
The text was updated successfully, but these errors were encountered: