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

🐛 BUG: <link rel="stylesheet"> inside Svelte component breaks client:visible #4191

Closed
1 task
isaac-mcfadyen opened this issue Aug 7, 2022 · 7 comments
Closed
1 task
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: svelte Related to Svelte (scope)

Comments

@isaac-mcfadyen
Copy link
Contributor

isaac-mcfadyen commented Aug 7, 2022

What version of astro are you using?

v1.0.0-rc.7

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

None

What package manager are you using?

yarn

What operating system are you using?

macOS Ventura (don't think it's related)

Describe the Bug

When using a <link rel="stylesheet" ...> inside a Svelte component, client:visible seems to break.

Any component with a stylesheet anywhere inside it and using client:visible will no longer be hydrated, no matter where on the page you scroll and even if it's directly visible. Removing the stylesheet causes things to immediately work again.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-fv7dts?file=src/pages/index.astro

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added this to Needs Triage in 🐛 Bug Tracker Aug 7, 2022
@natemoo-re natemoo-re added pkg: svelte Related to Svelte (scope) - P3: minor bug An edge case that only affects very specific usage (priority) s1-small labels Aug 8, 2022
@natemoo-re
Copy link
Member

Thanks for opening an issue! This is a strange one, we'll have to investigate what's going on here.

@pilcrowOnPaper
Copy link
Contributor

I think this issue is resolved?

Reproduction: https://github.com/pilcrowOnPaper/astro-svelte-visible-hydrate

@PuruVJ
Copy link

PuruVJ commented Nov 4, 2022

Not resolved for me yet, getting the same problem

@pilcrowOnPaper
Copy link
Contributor

@isaac-mcfadyen @PuruVJ @natemoo-re

2 things:

  • The reproduction works fine on my local machine
  • The reproduction on StackBlitz works fine when the stylesheet href is pointing to a local file (not external like https://unpkg.com/swiper/swiper-bundle.min.css)

From this, I think this is an issue with StackBlitz and network requests, and not Astro/Svelte.

@PuruVJ
Copy link

PuruVJ commented Nov 4, 2022

The reproduction is fine, but my local version with many MDX and Svelte files combined isn't working.

Update: It's not because of style. It's just not working at all 😅

@JerryWu1234
Copy link
Contributor

@natemoo-re what's the latest news for this bug? I want to found it

@bluwy bluwy self-assigned this Nov 10, 2022
@bluwy bluwy removed this from Needs Triage in 🐛 Bug Tracker Nov 14, 2022
@bluwy
Copy link
Member

bluwy commented Nov 17, 2022

Looks like this is working fine, but StackBlitz is blocking the unpkg request somehow causing it fail. If I run this locally, specify another external link that 404s, it renders fine too. Closing as fixed.

@bluwy bluwy closed this as completed Nov 17, 2022
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) pkg: svelte Related to Svelte (scope)
Projects
None yet
Development

No branches or pull requests

6 participants