Skip to content

SSR hydration warning: dynamic props on SVG elements are patched as properties instead of attributes #15081

Closed

Description

@rebeccarich

Version

3.5.39

Reproduction link

stackblitz.com

Steps to reproduce

  1. Open the reproduction.
  2. Open the browser devtools Console.
  3. Observe the [Vue warn]: Failed setting prop … error logged during hydration.

What is expected?

During hydration, dynamic props on SVG (and MathML) elements width, height, viewBox, etc. should be patched as attributes (via setAttribute) exactly as they are during normal client-side rendering. Hydration should be silent.

What is actually happening?

Since 3.5.39, dynamic props on SVG elements are patched as DOM properties during hydration, which throws for read-only SVG IDL properties:

[Vue warn]: Failed setting prop "viewBox" on <svg>: value 0 0 24 24 is invalid.
TypeError: Cannot set property viewBox of #<SVGSVGElement> which has only a getter
    at patchDOMProp
    at patchProp
    at hydrateElement
    at hydrateNode
    at hydrateSubTree
    at <App>

Nothing is visually broken but the console is flooded with warnings.


We ran across this issue in a Nuxt app but I believe the issue is coming from Vue core

Activity

  1. changed the title [-]SSR hydration warning: dynamic props on SVG elements are patched as DOM properties instead of attributes[/-] [+]SSR hydration warning: dynamic props on SVG elements are patched as properties instead of attributes[/+] on Jul 14, 2026
  2. added a commit that references this issue on Jul 14, 2026
    919fcba
  3. added
    🔨 p3-minor-bug
    on Jul 15, 2026
  4. locked and limited conversation to collaborators on Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugregressionscope:hydration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions