vue-meteor icon indicating copy to clipboard operation
vue-meteor copied to clipboard

Error on Meteor 1.8.2-beta.4

Open JanMP opened this issue 6 years ago • 12 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

JanMP avatar May 25 '19 07:05 JanMP

also see meteor/meteor#10522

JanMP avatar May 25 '19 07:05 JanMP

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!

benjamn avatar May 25 '19 15:05 benjamn

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

JanMP avatar May 25 '19 19:05 JanMP

@benjamn Is that repo helpful?

JanMP avatar Jun 19 '19 17:06 JanMP

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

jbl2024 avatar Oct 31 '19 10:10 jbl2024

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.

jbl2024 avatar Nov 16 '19 11:11 jbl2024

same

welkinwong avatar Nov 20 '19 18:11 welkinwong

@jbl2024 can you make a PR changing this line?

@Akryum any comment? Thanks

filipenevola avatar Nov 25 '19 14:11 filipenevola

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

thor-n avatar Dec 09 '19 14:12 thor-n

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 [email protected] https://github.com/jbl2024/vue-meteor
cp -r vue-meteor/packages/vue-component YOUR_METEOR_PROJECT/packages/

jbl2024 avatar Dec 09 '19 15:12 jbl2024

@jbl2024 thanks -i will look at it.

thor-n avatar Dec 20 '19 08:12 thor-n

Still saving this question.

pbrilius avatar Jan 16 '21 14:01 pbrilius