Skip to content

[Vapor] useTemplateRef prints a warn when updated #13665

@Ragnar-Oock

Description

@Ragnar-Oock

Vue version

3.6.0-alpha.2

Link to minimal reproduction

https://play.vuejs.org/#eNp9Uk1v1DAQ/SvTXLIrbbOUIg5LsghQJeAAqFTiEgm5ySRxcWzLH+miKP+9Y2fTdqWql8Se9+b5vbHH5JPW2eAx2SW5rQzXDiw6r2FgWpl9KXlPfwcjeIs32GvBHF5jswETPpXqtXdYwwSNUT2kJJV+KGUpKyWtg962UATqKv2KQij4o4yoz9L1QnDcCSTKqfoqjfV0TVIzz3bq/qjkjMcALFDHLLUQuJhZrdZQ7GfpbGDCI5wVBUgvROjLt3NQCkcbdzyVdgC5YLcooFGmKJOqw+rfrTqUyd6ptiWbUTHfRtLM55JOBPdf40kDDOe9qlFQMRinAq9PCNu5vbsIiQiJyrGPh+3ctB/HOMBpyrfdRbQLIW3ogR2M4zH5R0jDTFKqpQ0TFtNpCjGfRUs2ibM0roa32Z1Vkq57DGrkiYbGBZqf2nEaZ5mQcEACxujG7r/HWjhgs9Rjjhfqd5ai7Wjxy6BFM1CiR8wx06Kb4avfP/BA60eQhuVD/lfAa7RK+OBxpn32sibbz3jR7bf4XLlsb+zVwaG0S6hgNDCnyC8TeqhfXon+ZPcyexf7SjnRFP8OaIImDfAye5+9OWdCdyx7m0wPeYAZ7Q==

Steps to reproduce

  1. open and clear the browser console
  2. toggle the checkbox
  3. check the console for warnings

What is expected?

no warning should be printed to the console

What is actually happening?

Using useTemplateRef in a vapor component will trigger a warning each time the ref's value is updated (when the refed element is unmounted via v-if for example).

sample warning :

[Vue warn] Set operation on key "value" failed: target is readonly. 
Object { subs: {…}, subsTail: {…}, flags: 17, __v_isRef: true, __v_isShallow: true, _rawValue: h1, _oldValue: null, _value: h1, _wrap: undefined }

System Info

Any additional comments?

No response

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: vaporrelated to vapor mode

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions