core icon indicating copy to clipboard operation
core copied to clipboard

Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '"' is not a valid attribute name.

Open RGdevz opened this issue 3 months ago • 5 comments

Vue version

3.5.22

Link to minimal reproduction

https://play.vuejs.org/#eNp9kEFrAyEQhf+KzDlsDu0pLIG25NAe2tL26GVxJxtTV0XH7ULY/97RbdIEQhRheO9T38wBHryvhoSwgpqw96YhXEubd93qQUhY73S95LKo9fICqqMK2hPXOHoXSLS4bZIhcciuEPOZ8r0/EhZAUTm71V21j87yv8wyBcr1XhsMb560s1HCKr8ieElojHE/L0WjkHBx1NUO1fcVfR/HrEl4DxgxDCjh5FETOqTZ3ny+4sj1yexdmwzTN8wPjM6knHHGHpNtOfYZV9I+93kg2nZfcTMS2nhsKgfN5FR4CTz8pxut/8e9q+7LPR4oTL8VHZIa

Steps to reproduce

add element with a single " attribute like this

<div ">hi</div>

the error only happens for me on my mobile phone (last chrome) on desktop it's not happen

Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '"' is not a valid attribute name.
    at patchAttr (vue.runtime.esm-browser.js:11228:10)
    at patchProp (vue.runtime.esm-browser.js:11401:5)
    at mountElement (vue.runtime.esm-browser.js:7069:11)
    at processElement (vue.runtime.esm-browser.js:7016:7)
    at patch (vue.runtime.esm-browser.js:6882:11)
    at ReactiveEffect.componentUpdateFn [as fn] (vue.runtime.esm-browser.js:7513:11)
    at ReactiveEffect.run (vue.runtime.esm-browser.js:542:19)
    at setupRenderEffect (vue.runtime.esm-browser.js:7641:5)
    at mountComponent (vue.runtime.esm-browser.js:7415:7)
    at processComponent (vue.runtime.esm-browser.js:7367:9)

What is expected?

no error on both devices, or show error on both devices

What is actually happening?

error on mobile, no error on desktop

System Info


Any additional comments?

No response

RGdevz avatar Sep 29 '25 09:09 RGdevz

I think you just need to write it right. Does it have any impact

jiejie-color avatar Sep 29 '25 10:09 jiejie-color

It breaks the whole page render on mobile, make it difficult error to catch. it should throw error on compile or at least have the error happen on every device

RGdevz avatar Sep 29 '25 10:09 RGdevz

Just to add it's not just " but other symbols as well like ?,- etc. error only happens on mobile

RGdevz avatar Sep 29 '25 11:09 RGdevz

It happened to me too while using nuxt. i think it's some kind of bug in latest vue version. downgrade vue version and you are good to go.

UPDATE: it stoped working.

sadlrxn avatar Sep 30 '25 12:09 sadlrxn

Just spent 30 minutes to figuring out why it all works fine in Chrome Canary but doesn't in regular Chrome. Issue was in double " at the end of the string, but debug is very counterintuitive.

sergeybruhin avatar Nov 03 '25 09:11 sergeybruhin