You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which is truthy here since we're going from no scoped styles, to some scoped styles. So we emit a re-render message, and the client does all this correctly.
However, it seems deep in vue when it is diffing the two nodes, it never checks/realises that the previous node had no scopeId and this node does. So it never adds this new scopeId to the DOM nodes.
This means the scoped styles we successfully added simply don't apply to anything (nothing has that id in the DOM).
So yeah:
Should vue be diffing scopeId and adding the attribute?
or should vite be calling sendReload() in the check above? (that does make it work ofc)
The text was updated successfully, but these errors were encountered:
Hello 👋
I was poking around the repo and noticed an oddity with scoped styles.
Let's say you have this in a component somewhere (I used vite-app):
If you load it up using vite, all is fine. If you then change it to this:
It does not render the new colour.
Having stepped through this, i'm not sure if its vue's fault or if its vite's fault...
style-update
message correctly<head>
with the correct scope IDIn vite we do this:
vite/src/node/server/serverPluginVue.ts
Lines 226 to 228 in 5cdbc46
Which is truthy here since we're going from no scoped styles, to some scoped styles. So we emit a re-render message, and the client does all this correctly.
However, it seems deep in vue when it is diffing the two nodes, it never checks/realises that the previous node had no scopeId and this node does. So it never adds this new scopeId to the DOM nodes.
This means the scoped styles we successfully added simply don't apply to anything (nothing has that id in the DOM).
So yeah:
scopeId
and adding the attribute?sendReload()
in the check above? (that does make it work ofc)The text was updated successfully, but these errors were encountered: