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

Duplicated css import when hydrating Solid-js component in dev mode #6885

Closed
1 task
predaytor opened this issue Apr 21, 2023 · 0 comments · Fixed by #9531
Closed
1 task

Duplicated css import when hydrating Solid-js component in dev mode #6885

predaytor opened this issue Apr 21, 2023 · 0 comments · Fixed by #9531
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: styling Related to styles (scope) pkg: solid Related to Solid (scope)

Comments

@predaytor
Copy link

predaytor commented Apr 21, 2023

What version of astro are you using?

2.3.0

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Ubuntu (WSL)

What browser are you using?

Chrome

Describe the Bug

I use css-modules for shared styles in astro and solid-js components. When using hydration directives for a solid-js component, imported styles are duplicated and imported twice in the head after all previous styles, which breaks the layout for the entire page.

In the example, it's replacing astro styles due to import order.

The problem occurred only in dev mode. Also tested with SSR adapter, same behavior. Production on SSR/SSG works fine.

<link rel="stylesheet" href="/src/styles/container.module.css">
<style type="text/css" data-vite-dev-id="/home/predaytor/projects/astro-solid-duplicated-css/src/styles/container.module.css">
  ._container_19k93_1 {
      background-color: pink;
      inline-size: 300px;
      block-size: 300px;
      display: grid;
      place-items: center;
  }
</style>

Dev (hydration-off):
dev hydration-off

Dev (hydration-on):
dev hydration-on

Production (hydration-on):
production

Link to Minimal Reproducible Example

https://github.com/predaytor/astro-solid-duplicated-css

Participation

  • I am willing to submit a pull request for this issue.
@bluwy bluwy added feat: styling Related to styles (scope) pkg: solid Related to Solid (scope) - P3: minor bug An edge case that only affects very specific usage (priority) labels Apr 27, 2023
@bluwy bluwy self-assigned this Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: styling Related to styles (scope) pkg: solid Related to Solid (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants