Skip to content

Hydration errors style attribute since vue 3.4 #10336

Closed as not planned
Closed as not planned
@nestle49

Description

@nestle49

Vue version

3.4.19

Link to minimal reproduction

#10335

Steps to reproduce

  1. Create 2 DOM elements any ssr
  2. Create dependence style first element from style another, for example
<div :style="{ paddingRight: `${width + 10}px` }">
 Content
</div>

<button ref="cartButton">
Cart button
</button>
const cartButton = ref<HTMLElement>()
    const { width } = useElementSize(cartButton, undefined, {
        box: 'border-box'
    })

I tried using the onMounted hook but it doesn't seem to guarantee that the hydration process is complete, it seems like a bug. Is this really something that deserves warning?

this is more of a theoretical question, so I don't think reproduction is necessary, you can reproduce it in any minimal SSR

It seems that any style dependency on another style that changes on the client will give an error. We don't understand the concept?

What is expected?

No hydration errors

What is actually happening?

Hydration errors

Снимок экрана 2024-02-13 в 15 00 46

System Info

System:
    OS: macOS 14.3
    CPU: (8) arm64 Apple M1
    Memory: 69.20 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.5.1 - ~/.nvm/versions/node/v20.5.1/bin/node
    npm: 9.8.0 - ~/.nvm/versions/node/v20.5.1/bin/npm
  Browsers:
    Chrome: 121.0.6167.160
    Safari: 17.3
  npmPackages:
    vue: ^3.4.19 => 3.4.19

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions