-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
:visible
components throw error
#110
Comments
Merged
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduction
Modify
/examples/kitchen-sink/astro/pages/index.astro
to add:visible
to any component.When the page loads, the following error will occur:
Issue
Here's the generated JS that's breaking:
It looks like #72 changed how the IntersectionObserver gets set up to support having multiple components:
https://github.com/snowpackjs/astro/blob/188541260acad5ccd6699f0a21d6da600860e74c/src/frontend/render/renderer.ts#L58
It's now expecting
root
to be a call toquerySelectorAll
instead ofquerySelector
, but it's stillquerySelector
:https://github.com/snowpackjs/astro/blob/188541260acad5ccd6699f0a21d6da600860e74c/src/frontend/render/renderer.ts#L23
As far as I can tell, all of the renderers are expecting
root
to be a call toquerySelector
, and the IntersectionObserver bit is the only part of the generated code that expectsquerySelectorAll
. It seems like reverting the change to this line would fix:visible
, but as I don't really know the context of the previous change, I don't know what else that might break.The text was updated successfully, but these errors were encountered: