solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

[Bug?]: Required CSS is removed when components are re-exported

Open iisakkirotko opened this issue 9 months ago • 3 comments

Duplicates

  • [x] I have searched the existing issues

Latest version

  • [x] I have tested the latest version

Current behavior 😯

Upon navigation some CSS that should be included in the page is removed from it.

Expected behavior 🤔

The CSS is not removed, and instead kept on the page.

Steps to reproduce 🕹

Steps:

  1. Go to this stackblitz example
  2. Navigate to About
  3. The link to About is not red

Context 🔦

I ran into an issue while building a relatively simple app today. I wanted to import my components more cleanly as

import { MyComponent, OtherComponent } from '~/components';

instead of

import { MyComponent } from '~/components/mycomponent';
import { OtherComponent } from '~/components/othercomponent';

So I created an index file to re-export them from, and imported all required custom components from there instead. However, I noticed that this always breaks the CSS of my navigation element, which is included in the root layout in app.tsx. I think this might be related to https://github.com/solidjs/solid-start/issues/1401.

It's possible to work around this by importing the components from their own files.

Let me know if the issue should be raised elsewhere instead. Thanks a lot for your excellent work on Solid!

Your environment 🌎


iisakkirotko avatar Mar 03 '25 20:03 iisakkirotko

@katywings do you have ideas on this css issue? Probably a vinxi thing?

brenelz avatar Mar 04 '25 03:03 brenelz

@brenelz (@iisakkirotko) Yeah, this sounds like either a regression or an edgecase that wasn't already fixed by nksaraf/vinxi@ce137037fe3aa3b8c953def11ed55dcf3e1f104 🙈. I recommend for now to import the components from their direct files. We are currently conceptualizing a future css solution together with Tanstack and with a bit of luck, we can skip fixing the open css bugs for the old solution 😅.

katywings avatar Mar 06 '25 19:03 katywings

Alright, thanks for the update!

iisakkirotko avatar Mar 07 '25 12:03 iisakkirotko