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

Components loaded using lazy missing SSR styles #10178

Open
ramiroazar opened this issue Oct 30, 2024 · 0 comments
Open

Components loaded using lazy missing SSR styles #10178

ramiroazar opened this issue Oct 30, 2024 · 0 comments

Comments

@ramiroazar
Copy link
Contributor

Reproduction

  1. Open reproduction
  2. Load route /one
  3. Notice styles do load, but with a delay (ie. red background)
  4. Disable JavaScript
  5. Click "Go to page two" to load route /two (ie. blue background)
  6. Notice styles don't load
  7. Replace lazy imports with regular imports in /components/RoutePage.tsx
  8. Notice expected behaviour (ie. styles are loaded with JavaScript disabled and without delay)

System Info

System:
    OS: macOS 14.5
    CPU: (16) x64 Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
    Memory: 37.25 GB / 72.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.2.0 - ~/.nvm/versions/node/v22.2.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v22.2.0/bin/npm
  Browsers:
    Brave Browser: 127.1.68.141
    Chrome: 130.0.6723.91
    Safari: 17.5

Used Package Manager

npm

Expected Behavior

Styles imported by components loaded using lazy should also be server side rendered.

Actual Behavior

If components are loaded using lazy, they're correctly server side rendered, but their styles are only rendered on the client if JavaScript is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant