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

Unescaped character in CSS variable name when using css v-bind() during SSR dev #7823

Closed
loicpennequin opened this issue Mar 3, 2023 · 1 comment · Fixed by #8824
Closed

Comments

@loicpennequin
Copy link

Vue version

3.2.47

Link to minimal reproduction

https://stackblitz.com/edit/nuxt-starter-kqlpac?file=app.vue

Steps to reproduce

Load the application.

What is expected?

The paragraph is always red

What is actually happening?

The paragraph is unstyled (no background color) and becomes red when hydration occurs.

System Info

No response

Any additional comments?

The problem comes from the fact that the v-bind expression contains a . character which is not being escaped during SSR.
the CSS variable names is --938b83b0-style.color and becomes --938b83b0-style\.color during hydration

@edison1105
Copy link
Member

edison1105 commented Mar 8, 2023

This only happens in SSR development mode, and the root cause is:
image
When \ appears in the key of an object, it will be lost. Therefore, it needs to be escaped again.
The complete fix requires merging #6979 and #7861.

@sodatea sodatea changed the title Unescaped character in CSS variable name when using css v-bind() during SSR Unescaped character in CSS variable name when using css v-bind() during SSR dev Apr 4, 2023
edison1105 added a commit to edison1105/vuejs-core that referenced this issue Oct 20, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants