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

fix(server-renderer): should work with css vars #6952

Closed
wants to merge 1 commit into from

Conversation

rudyxu1102
Copy link
Contributor

@rudyxu1102 rudyxu1102 commented Oct 25, 2022

Fix #6926.

watchPostEffect is used in the useCssVars so that the effect can execute asynchronously.

But the effect will execute immediately when using watchPostEffect in the ssr.

Maybe the PR can fix that.

@@ -285,7 +285,11 @@ function doWatch(
// we will also not call the invalidate callback (+ runner is not set up)
onCleanup = NOOP
if (!cb) {
getter()
if (flush === 'post') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This's not the proper fix.
In SSR there is no need to setup an effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, then i close it. Looking forward to your solution.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useCssVars only work at runtime.
I believe we should not inject useCssVar() at the server.

@rudyxu1102 rudyxu1102 closed this Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v-bind css variable crashes during ssr dev
2 participants