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
{{ message }}
This repository has been archived by the owner on Sep 6, 2020. It is now read-only.
TypeError: Vue.set is not a function
at Errors.set (Errors.js?4eb3:23)
at new Errors (Errors.js?4eb3:7)
at Model.setData (Model.js?6d83:32)
at new Model (Model.js?6d83:12)
at VueModel.$model (VueModel.js?f341:38)
at apply (lodash.js?3387:496)
at wrapper (lodash.js?3387:5356)
at VueComponent.eval [as $model] (VueModel.js?f341:171)
at VueComponent.loadData (HelloWorld.vue?b703:39)
at Proxy.boundFn (vue.esm.js?efeb:187)
Any ideas?
The text was updated successfully, but these errors were encountered:
I guess it happens because you're using Vue.js bundled as ES2016 module -- I see vue.esm.js file in your backtrace.
The problem is that vue-model is trying to require vue.js using node.js require directive. However when vue is provided as ES2016 module, requiring it doesn't work this way anymore.
The only solution I came up with is to replace requires with ES2016 imports. This works for me, but it obviously breaks the compatibility with environments where ES2016 is not available. Unfortunately I don't know a better solution, otherwise I would provide a PR.
Ran into this same problem today. I've been messing around with Vuex server-side and was using Vue.set in my mutations, and then started running the same mutations client-side and was like WHAT IS WRONG THESE ARE THE SAME.
I'm guessing it's just because I'm using Nuxt but I enabled Typescript? @cmrd-senya 's solution worked for me (using import/from syntax instead of require syntax)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I created a new project with vue-cli, added vue-model dependency and want to try it out.
I have this:
Now I want to load all models from the server:
And I get:
Any ideas?
The text was updated successfully, but these errors were encountered: