$listeners is readonly. $attrs is readonly.
See original GitHub issueHello. I have an error when using vue-property-decorator
in my additional library.
From this stackoverflow answer.
Vue is being loaded/packed into the bundle by webpack and also loaded externally (not via webpack)
https://stackoverflow.com/a/50932919/5988531
I do something like this in my main.ts
:
import MyIcon from '<my-external-library>/src/components/icon/icon.vue';
Vue.component('my-icon', MyIcon);
Then, I use my-icon
in the project and got an error.
Do you have any comments or suggestions for this?
P.S. I think this is because We need to extend Vue class in *.vue
file. Can I use property decorators without extending a Vue instance?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:11 (1 by maintainers)
Top Results From Across the Web
"$attrs is readonly","$listeners is readonly","Avoid mutating a ...
I am new to Vue. I am trying to develop a chatting application where friend list will be shown on the left menu...
Read more >SOLVED: [Vue error] $attrs is readonly / $listeners is ... - GitHub
Hello everyone! I have a problem with bootsrap-vue. I use vue cli 3 and an error appears $attr $listener readonly. Please help ^^ ......
Read more >[Vue warn]: $attrs is readonly - Get Help
Hi! I get warnings on keypresses, they are: [Vue warn]: $attrs is readonly. [Vue warn]: $listeners is readonly. [Vue warn]: Avoid mutating a ......
Read more >Vue warning: $attrs is readonly. - Material Design for Bootstrap
I keep getting this error in the console (see video), but only as soon as I work with routes.
Read more >Vue warn $listeners and $attrs is readonly - Stack Overflow
I am getting a lot of Vue warnings saying $listeners is readonly or $attrs is readonly and related to different Bootstrap items or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure. So by saying that the library is marked as external, you tell webpack/rollup not to bundle it together with the rest of js files, even if the library is referenced from js files.
You push the responsibility of providing this library (eg. vue-property-decorator) to the application consuming your library. I was using rollup in my project. Everything described in more verbose way here: https://rollupjs.org/guide/en#peer-dependencies, and I see that webpack has something similar: https://webpack.js.org/configuration/externals/
+1
I customized a component and introduced it into the project in the form of link npm, which triggered this error