vuetify: [Bug Report] warning with VueJS 2.6.11
Environment
Vuetify Version: 2.1.15 Vue Version: 2.6.11 Browsers: Chrome 79.0.3945.79 OS: Linux x86_64
Steps to reproduce
Use a VCalendar
https://codepen.io/pen/?&editable=true&editors=101
Expected Behavior
No warning expected
Actual Behavior
A warning is displayed:
[Vue warn]: The .native modifier for v-on is only valid on components but it was used on <div>.
found in
---> <VCalendarMonthly>
<VCalendar>
<VSheet>
<VApp>
<Root>
Reproduction Link
https://codepen.io/sshenron/pen/povRRgj?&editable=true&editors=101#anon-signup
Other comments
No warning with VueJS in 2.6.10.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 169
- Comments: 41 (15 by maintainers)
Commits related to this issue
- Add some code to ignore a not needed message. related: https://github.com/vuetifyjs/vuetify/issues/9999 — committed to werner/event_calendar_front by werner 4 years ago
- fix: don't use nativeOn on native elements fixes #9999 — committed to vuetifyjs/vuetify by KaelWD 4 years ago
- fix: don't use nativeOn on native elements fixes #9999 — committed to vuetifyjs/vuetify by KaelWD 4 years ago
- fix(VCalendar): don't use nativeOn on native elements (#11112) fixes #9999 * fix(VCalendar): don't use nativeOn on native elements * fix(VList): don't use nativeOn when inactive — committed to vuetifyjs/vuetify by KaelWD 4 years ago
- fix: don't use nativeOn on native elements (#11228) fixes #9999 * fix: don't use nativeOn on native elements * fix(VList): don't use nativeOn when inactive * fix(VListItem): don't use mergeD... — committed to vuetifyjs/vuetify by KaelWD 4 years ago
- 次のエラーが発生するのでVuetifyのバージョンを2.3.14に上げておく。https://github.com/vuetifyjs/vuetify/issues/9999 — committed to shin-sumi/practice-vue.js-hans-on by deleted user 3 years ago
- VueApp: von Vue 2.6.11 wieder auf 2.6.10 gegangen - Problem mit Vuetify Calender: https://github.com/vuetifyjs/vuetify/issues/9999 — committed to Oberverwaltungsgericht-Rheinland-Pfalz/OVGRLP-Ressourcenplanung by deleted user 4 years ago
Not a workaround, but just too hide it:
It was too annyoing so I went into the vue folder in node_modules, project search and removed the following
Although the warning was intentional as mentioned above by @icleolion. We can handle the Vue Warnings from
main.jssomething like thisNot the best way but if you are frustrated by the console error just because you are using one of the vuetify component (v-calendar for me). Hope that helps 😅.
Seeing this also on VIcon
I’m assuming it’s related to https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/components/VIcon/VIcon.ts#L194
Its a combination of both us and upstream, there is an open PR for the upstream issue (which may or may not resolve the issue).
There is no need to keep spamming the post. a simple 👍 on the initial thread will suffice to show interest. We also kindly encourage the community, if they have the time, to submit PR’s as well. Sir Lamar’s seems to have a pretty good starting point.
Current ways around the warning right now are disable it (not recommended) or staying on
2.6.10That’s not the solution.
any news on this? as right now seems like faSvg is totally unusable with vuetify.
Same problem here today:
I had the same error here, any updates?
To be clear, I’m pretty sure this is a new error message in Vue, but it was meant to be implemented as a warning, not a console error. It remains the case that some Vuetify components are implementing the “native” modifier on their children elements, and so if that child is not itself a Vue component, this error is thrown. Vuetify should be checking to see if the child element is already native HTML before applying this modifier.
Hi, I have the same issues with nuxt when I use v-calendar, I have the latest version of nuxt. is-there a new solution to solve it please ?
The solution is, in every case where this pattern is used in Vuetify:
I would submit a PR for this except I don’t have much experience with hard-coding “render” methods as are used throughout Vuetify.
Doing hacky work-around things just to suppress the warning is a mistake. The warning exists for a reason.
For those still having issue with VIcon and are tracking this issue, figured I’d drop a note in here to say that https://github.com/vuetifyjs/vuetify/pull/12148 has resolved the issue for VIcon now also. With both VIcon and VCalendar now fixed, you can now upgrade beyond Vue 2.6.10 without having your console flooded with errors!
Here’s a temporary workaround usage of ignoring this message using warnhandler API as suggested above by @Mondal10. This version passes through everything except the ignored message as console errors, where the original suggestion does not.
In main.js/ts:
A workaround is to create a wrapper component that wraps the fa component in a div, this will work.
custom component
register a custom icon and use the component
then it is usable like this
I think that is “hack” for me, but it works and resolve problem without turning-Off of warnings. I’m just replace all “nativeOn” listeners in /node_modules/vuetify/dist/vuetify.js to “On” (without native). All works and doesn’t push any warnings.
It’s cool that everyone is having the same problem, but could future people please not spam this thread? Instead use the “Subscribe” button in the right sidebar to be notified of any changes. Thanks!
So is the intention for #11228 to fix VIcon this time around? Or do I need to raise a separate issue for that to be resolved via another method?
I have same proplem when using VCalendar
The same… (( Vuetify v2.2.13 Vue v2.6.11