Skip to content

redundant ref="[object Object]" attribute rendered in custom element on SSRΒ #14274

@kingyue737

Description

@kingyue737

Vue version

v3.5.26@aac7e18

Link to minimal reproduction

https://play.vuejs.org/#__SSR__eNp9Uk1PwzAM/StRLh1S6Q5wKgMJ0CRAfAk45lJ17hponSpxYWjqf8dxN+gByCWJn5/z8uytPu+67L0HnetFKL3tSAWgvjszaNvOeVJ3n5eOTwhIqvKuVUk2n8SSE4MGF/ORzDS+ELRdUxDwTanFtMCcQ4v5BNepplA6rOw6ew0OWcc2sowumWQb8A8dWYfB6FwJErGiadzHjcTI95Du42UN5dsv8dewiTGjHz0E8O9g9DdGhV8DjfDy+R42fP4GW7fqG87+B3yC4Jo+ahzTLnpcsexJnqi9Fjctrl/CckOAYf+pKDRmDpJvNDcj+vXX13/kHmXHwjM4sIsTlzMKbOOufVu1gsqi1BQ0VXWqQi2inqBSw66r/G4Suwcb4TGr6BvZp+yZCMGihVwly7IuPIVElFuswVs6J/IhV1XRhNF/GafZwf4H3OtAyjtH6nQiY3YgcxQzPBM8KqacygDFVc+S9vMwjsQ4dOm+3Eiocqm4czwuiwj+6uXulmXWwI+MIuMa4lOj33LUwxd+Zf66

Steps to reproduce

When I use template ref on a custom element in SSR mode. It will render a ref="[object Object]" attribute unexpectedly:

<my-component ref="[object Object]">hello</my-component>

What is expected?

<my-component>hello</my-component>

What is actually happening?

<my-component ref="[object Object]">hello</my-component>

System Info

Any additional comments?

originally posted in nuxt/nuxt#34016
The reproduction on Vue playground is provided by @danielroe

Metadata

Metadata

Assignees

No one assigned

    Labels

    πŸ”¨ p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope:hydration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions