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

Computed value not updated in SSR #5300

Closed
SquidEpps opened this issue Jan 20, 2022 · 1 comment
Closed

Computed value not updated in SSR #5300

SquidEpps opened this issue Jan 20, 2022 · 1 comment
Labels
p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working

Comments

@SquidEpps
Copy link

Version

3.2.27

Reproduction link

github.com

Steps to reproduce

yarn

node index.js

What is expected?

Computed value is updated and html renders with correct message.

<div>hello world</div>

What is actually happening?

Computed value is not updated and an empty div is rendered.

<div></div>

I'm not sure if this a bug or is it me misusing computed in SSR context, but such an app architecture as in my reproduction demo seems to me completely valid and should work.

There is a computed value in a component which is based on part of app's state. No value serves as indication of the need to fetch data. Normally this should happen either during SSR or on the client if the state (or its part) was not hydrated. Async setup function allows to wait for data to be fetched which should trigger an update of state and computed value.

This acually worked in 3.2.26. New behavior was possibly introduced in commit f4f0966

@yyx990803 yyx990803 added p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working labels Jan 21, 2022
@ylinH-git
Copy link

this.effect.active = !isSSR

maybe this code make computed inactive in SSR env?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants