You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go into lib, install dependencies and build it with npm run build.
Go into app, install dependencies.
Serve the app in the browser with npm run serve. Open the browser devtools and check for errors in the console while clicking the button.
Serve the app in an Electron shell with npm run electron:serve. Repeat the above procedure, monitoring for errors in the Electron devtools console.
What is expected?
No console errors should appear in either case.
What is actually happening?
When serving as an Electron app, three errors appear every time the button is clicked.
[Vue warn]: $attrs is readonly.
...
[Vue warn]: $listeners is readonly.
...
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "message"
I've done some digging and it seems a number of projects have encountered this problem when their libraries are used in Electron apps. It has something to do with the Electron renderer process using a different version of the Vue bundle than the one the library uses - these two Vue bundles conflict with each other.
This issue comment sheds some light on the issue, although I haven't yet tried the solution the person proposes. The reason I'm opening this as a vue-cli issue is that I was able to reproduce this bug with a minimal app & library created directly through vue-cli, and I'm wondering if it would be possible to change something in the webpack config that vue-cli generates by default that will make Vue component libraries built with it work in Electron apps without this sort of difficulty. If this isn't possible, maybe an alternative could be documenting this behaviour somewhere, with suggestions to workaround it.
The text was updated successfully, but these errors were encountered:
Version
3.0.0-rc.1
Reproduction link
https://github.com/TAGC/vue-electron-bug
Steps to reproduce
lib
, install dependencies and build it withnpm run build
.app
, install dependencies.npm run serve
. Open the browser devtools and check for errors in the console while clicking the button.npm run electron:serve
. Repeat the above procedure, monitoring for errors in the Electron devtools console.What is expected?
No console errors should appear in either case.
What is actually happening?
When serving as an Electron app, three errors appear every time the button is clicked.
I've done some digging and it seems a number of projects have encountered this problem when their libraries are used in Electron apps. It has something to do with the Electron renderer process using a different version of the Vue bundle than the one the library uses - these two Vue bundles conflict with each other.
This issue comment sheds some light on the issue, although I haven't yet tried the solution the person proposes. The reason I'm opening this as a vue-cli issue is that I was able to reproduce this bug with a minimal app & library created directly through vue-cli, and I'm wondering if it would be possible to change something in the webpack config that vue-cli generates by default that will make Vue component libraries built with it work in Electron apps without this sort of difficulty. If this isn't possible, maybe an alternative could be documenting this behaviour somewhere, with suggestions to workaround it.
The text was updated successfully, but these errors were encountered: