-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
text is undefined
error with hydrated slotted component with default slot contents using bound computed properties
#1144
Comments
Finally taking a poke at this — it's a hell of a bug. Think I've whittled it down to this — if the default slotted content has anything dynamic, it causes problems. Your repro was using Sapper 0.5.1 which actually got hydrating backwards (the only time it didn't hydrate was on the first load), so this isn't a hydration bug per se. Closing in on a fix... |
Rich-Harris
added a commit
that referenced
this issue
Feb 24, 2018
Rich-Harris
added a commit
that referenced
this issue
Feb 24, 2018
Rich-Harris
added a commit
that referenced
this issue
Feb 24, 2018
wrap <slot> updates in conditional
Fixed in 1.56 — thanks |
Woo thanks, nice work! |
This was referenced Mar 14, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The setup is as convoluted as the title suggests, ha. I'm trying to do something pretty stupid, so I'm not exactly surprised that things break, but I found it interesting it seems to happen only when all of these conditions are met.
Essentially, I'm trying to duplicate Vue's scoped slots using a bound property. The parent renders a slotted component, passing in data and receiving some transformed data back using a bound property. The slotted component has some default content which is being overridden from the parent, but both contents are rendered using the same computed value.
This all works in a normal component, but it breaks when the component is hydrated after being server rendered. As such, if using Sapper you navigate to the page, everything works, but if you reload the page it breaks. Additionally, if the slotted child doesn't have any default content, everything works fine as well.
Repro repo
(That HMR error is unrelated, the same thing happens when running in production mode).
Parent:
Slotted child:
Thanks!
The text was updated successfully, but these errors were encountered: