question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

I’m submitting a … (check one with “x”)

[x] Bug report => search github for a similar issue or PR before submitting
[ ] Feature request
[ ] Other, please describe

Tell about your platform

  • Vue.js version : 3.2.22
  • Browser name and version : Chrome 96
  • This package version : 2.0.1

Current behavior Whenever I call this.$toast.open('.'); I get:

runtime-core.esm-bundler.js?5c40:6769 Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '0' is not a valid attribute name.
    at patchAttr (webpack-internal:///./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js:473:16)
    at patchProp (webpack-internal:///./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js:672:9)
    at mountElement (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:3946:25)
    at processElement (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:3918:13)
    at patch (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:3838:21)
    at ReactiveEffect.componentUpdateFn [as fn] (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:4377:21)
    at ReactiveEffect.run (webpack-internal:///./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js:195:29)
    at setupRenderEffect (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:4496:9)
    at mountComponent (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:4279:9)
    at processComponent (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:4237:17)
logError @ runtime-core.esm-bundler.js?5c40:6769
handleError @ runtime-core.esm-bundler.js?5c40:6755
callWithErrorHandling @ runtime-core.esm-bundler.js?5c40:6709
callWithAsyncErrorHandling @ runtime-core.esm-bundler.js?5c40:6715
invoker @ runtime-dom.esm-bundler.js?830f:350

Minimal reproduction of the problem with instructions

I just followed the instructions. I have the line above to show the toast and createApp(App).use(router).use(VueToast).mount('#app'); in main.ts

using class components and hammer but no other libs

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
misteryomicommented, Dec 30, 2021

@yspreen

Use it this way:

this.$toast.open({
    message: 'Something went wrong!',
    type: 'error', //specify `success` or `error` here
    // all of other options may go here
});
0reactions
victor-ponamariovcommented, Jan 24, 2022

This doesn’t work for me:

this.$toast.open('You did it!');

with the same exception

This works

this.$toast.open({
    message: 'Something went wrong!',
    type: 'error', //specify `success` or `error` here
    // all of other options may go here
});

Read more comments on GitHub >

github_iconTop Results From Across the Web

']' is not a valid attribute name. angular 4 - Stack Overflow
Failed to execute 'setAttribute' on 'Element': ']' is not a valid attribute name. I simply made model: export interface ModalComponentModel { ...
Read more >
Failed to execute 'setAttribute' on 'Element': '0' is not a valid ...
Hey, I'm creating a new module for Nuxt and when I'm adding a plugin pushing a script to the DOM, the following error...
Read more >
Failed to execute 'setAttribute' on 'Element'" error occurs when ...
The "Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '[expanded]' is not a valid attribute name." error occurs:.
Read more >
Failed to execute 'setAttribute' on 'Element': '(click)' is not a ...
I'm trying to execute a function after clicking, ... Failed to execute 'setAttribute' on 'Element': '(click)' is not a valid attribute name.
Read more >
Failed to execute 'setAttribute' on 'Element': 'online..."' is not a ...
Uncaught DOMException : Failed to execute 'setAttribute' on 'Element': 'online..."' is not a valid attribute name.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found