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(compiler-sfc): avoid gen useCssVars when targeting SSR #6979

Merged
merged 10 commits into from
Oct 21, 2023

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Oct 28, 2022

fix #6926
the repl also has a bug see vuejs/repl#85

@edison1105 edison1105 changed the title fix(compiler-sfc): avoid gen useCssVars when targeting SSR in scriptSetup fix(compiler-sfc): avoid gen useCssVars when targeting SSR Apr 12, 2023
@edison1105 edison1105 requested a review from yyx990803 April 12, 2023 05:38
@github-actions
Copy link

github-actions bot commented Sep 29, 2023

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 85.9 kB 32.7 kB 29.5 kB
vue.global.prod.js 132 kB 49.4 kB 44.3 kB

Usages

Name Size Gzip Brotli
createApp 47.9 kB 18.9 kB 17.2 kB
createSSRApp 50.7 kB 20 kB 18.2 kB
defineCustomElement 50.3 kB 19.7 kB 18 kB
overall 61.3 kB 23.7 kB 21.6 kB

@yyx990803
Copy link
Member

Some context: the reproduction in #6926 was deleted, but the cause of the original issue is that useCssVars codegen was only skipped for SSR + inline mode. So the code is still generated for non-inlined mode (only in webpack / vue-loader SSR setup), and the effect getter is run immediately in SSR, leading to the error.

@yyx990803 yyx990803 merged commit c568778 into vuejs:main Oct 21, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

v-bind css variable crashes during ssr dev
2 participants