meteor-vue / vue-meteor

🌠 Vue first-class integration in Meteor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error on Meteor 1.8.2-beta.4

JanMP opened this issue · comments

In an App that works fine with Meteor 1.8.1 I get this error after updating to 1.8.2-beta.4:

AppLayout.vue:42 Uncaught TypeError: _Vue.component is not a function
    at AppLayout.vue (AppLayout.vue:42)
    at fileEvaluate (modules-runtime.js?hash=0ba1f02e48d68e39631c5674a06607fabab6101e:346)
    at Module.require (modules-runtime.js?hash=0ba1f02e48d68e39631c5674a06607fabab6101e:248)
    at require (modules-runtime.js?hash=0ba1f02e48d68e39631c5674a06607fabab6101e:268)
    at app.js?hash=c5fbae48585dabd4ac1bf87ce2c7582e0b33250f:1298

Any chance you could put together a small runnable Vue+Meteor app that reproduces the problem? If it's hard to reproduce outside of your app, I understand, but hopefully the problem will be obvious and the reproduction will be easy. Thanks in advance!

Except for the addition of the pug, coffeescript and sass packages this is a minimum setup for a meteor-vue app with just one component: https://github.com/JanMP/meteor-vue-setup

@benjamn Is that repo helpful?

Hi,
i'm stuck with the same issue on my app with 1.8.2-rc.4
Btw this issue is reproducible also on this sample project: https://github.com/meteor-vue/todomvc.git

Same error on 1.8.2.
After digging into source code, i found that

var _Vue = require('vue')

should be

var _Vue = require('vue').default

I don't know why this change is needed for 1.8.2.
Anyway you can test it by copying the vue-component folder into local packages directory of your app.

Hope it helps.

same

@jbl2024 can you make a PR changing this line?

@Akryum any comment? Thanks

I have the same problem, howto use the code fix on my meteor/vue project?

imho you have 2 options:

  • first option: do not rely on auto registration

Move your components in imports folder (https://github.com/meteor-vue/vue-meteor/tree/master/packages/vue-component#automatic-components-registration) and auto import them yourself (https://vuejs.org/v2/guide/components-registration.html#Automatic-Global-Registration-of-Base-Components)

  • second option: clone my temp fix in your ./packages directory
git clone --branch meteor@1.8.2 https://github.com/jbl2024/vue-meteor
cp -r vue-meteor/packages/vue-component YOUR_METEOR_PROJECT/packages/

@jbl2024 thanks -i will look at it.

Still saving this question.