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: Loss of reactivity in Vue component (production only) #2530

Closed
evanaustin opened this issue Feb 3, 2022 · 3 comments · Fixed by #3455
Closed

🐛 BUG: Loss of reactivity in Vue component (production only) #2530

evanaustin opened this issue Feb 3, 2022 · 3 comments · Fixed by #3455
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) pkg: vue Related to Vue (scope)

Comments

@evanaustin
Copy link

What version of astro are you using?

0.22.20

What package manager are you using?

yarn on my machine / npm in StackBlitz

What operating system are you using?

Mac

Describe the Bug

Hey team, I seem to be running into an issue with reactivity after a component has been rendered in production/built mode.

These are Vue components, and I'm hydrating them with client:only (though it didn't seem to work regardless of how I try to hydrate it).

In essence, I have a standalone class instance that holds a given user's authenticated state; this instance is initially populated via an API response after the client loads. Elsewhere, other components expect to be able to use the populated data from the same instance. As you would imagine, the proxy/value being requested would initially be null ... until the API response comes back and the proxy is updated.

In dev, it works as intended: when the proxy updates, the view is updated as well. In production, however, the view does not update after the proxy updates. With a console.log(), though, you'll see that the proxy itself does ultimately update.

See the attached StackBlitz with some stripped down code to help illustrate the issue.

Thanks in advance!

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-jhuzfh-qhxzzn?devtoolsheight=33&file=src/layouts/BaseLayout.astro

@github-actions github-actions bot added this to Needs Triage in 🐛 Bug Tracker Feb 3, 2022
@jonathantneal jonathantneal moved this from Needs Triage to Accepted in 🐛 Bug Tracker Feb 3, 2022
@evanaustin evanaustin changed the title 🐛 BUG: 🐛 BUG: Loss of reactivity in Vue component Feb 5, 2022
@evanaustin evanaustin changed the title 🐛 BUG: Loss of reactivity in Vue component 🐛 BUG: Loss of reactivity in Vue component (production only) Feb 5, 2022
@matthewp matthewp added - P4: important Violate documented behavior or significantly impacts performance (priority) pkg: vue Related to Vue (scope) s2-medium and removed bb:investigate labels May 10, 2022
@matthewp
Copy link
Contributor

I'm able to recreate, here's a newer stackblitz still showing the problem. https://stackblitz.com/edit/github-jhuzfh-qz3ye9?devtoolsheight=33&file=package.json,src%2Fcomponents%2FClient.vue,astro.config.mjs

This seems to be Vue-specific and likely related how we set up the island.

@matthewp matthewp removed their assignment May 10, 2022
@tony-sull
Copy link
Contributor

May be related to the store being out of sync? #2658

@tony-sull tony-sull removed their assignment May 20, 2022
@natemoo-re natemoo-re self-assigned this May 23, 2022
@natemoo-re natemoo-re linked a pull request May 26, 2022 that will close this issue
@natemoo-re
Copy link
Member

I am pretty confident this is fixed by #3455 as I was able to get the reproduction working locally. Please feel free to re-open this if you're still having trouble once that fix goes out in the next release, though!

🐛 Bug Tracker automation moved this from Accepted to Done May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) pkg: vue Related to Vue (scope)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants