Skip to content
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

Hydration issues when using SSR frameworks like Next.js and Remix #377

Open
Fbasham opened this issue Jan 18, 2024 · 1 comment
Open

Hydration issues when using SSR frameworks like Next.js and Remix #377

Fbasham opened this issue Jan 18, 2024 · 1 comment
Labels
development Development tasks enhancement New feature or request ssr

Comments

@Fbasham
Copy link

Fbasham commented Jan 18, 2024

When integrating the GC Design System with metaframeworks that support SSR, like Next.js and Remix, there are hydration issues that appear in the console.

What appears to to be happening is that the initial page load will happen on the server with GC Design Components loading as much of their content as possible, then the subsequent hydration of styles will take over on the client. It appears that styles are injected into the head of the document on the client.

It would be nice if there was any guidance on how to resolve this issue. Can the GC Design System be used with SSR without needing to load styles on the client? Can components be loaded server side? Is the GC Design system primarily used with SPA applications?

The following images are coming from a Remix application using the GC Design Design System.

Errors in the console:

image

What appears to be injected styles in the head:

image

After scripts are disabled:

image

@ethanWallace
Copy link
Collaborator

At the current moment, the GCDS does not work well in SSR environments since it is built with web components but with that being said we are currently developing a package that would take advantage of declarative shadow-dom to allow SSR. You can follow the progress on the gcds-components-ssr branch.

We are doing a majority of the testing with Nextjs but will make sure to document the results working with Remix as well.

@daine daine added enhancement New feature or request ssr labels Jan 24, 2024
@daine daine added the development Development tasks label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Development tasks enhancement New feature or request ssr
Projects
None yet
Development

No branches or pull requests

3 participants