GithubHelp home page GithubHelp logo

Comments (9)

Atinux avatar Atinux commented on May 17, 2024 2

@declandewet @lijiakof I had the same error with nuxt.js when using vue-meta 👷

It's because of jsnext, it was fixed by importing vue-meta this way:

import Meta from 'vue-meta/lib/vue-meta.js' // require the ES2015 lib

I believe it is because on the jsnext import (trough Webpack), Vue does not check the plugin.install.default here: https://github.com/vuejs/vue/blob/dev/dist/vue.common.js#L3219

from vue-meta.

zspecza avatar zspecza commented on May 17, 2024

Hi @achen224 - thanks for the report.

I've tried reproducing your issue but it works for me. Could you perhaps provide more info? e.g. the line in your source file causing the issue + webpack config (if any)

from vue-meta.

lijiakof avatar lijiakof commented on May 17, 2024

I use it base on vue 2.0.5,and has the same error.Uncaught TypeError: plugin.apply is not a function(…) vue.common.js:3219

from vue-meta.

zspecza avatar zspecza commented on May 17, 2024

@lijiakof are you passing any options to vue-meta? can I see some code that depicts how you're using vue-meta? would be a big help 👷

@Atinux have you run into this, by any chance?

from vue-meta.

zspecza avatar zspecza commented on May 17, 2024

Thanks @Atinux - I will look into a fix for this shortly

from vue-meta.

achen224 avatar achen224 commented on May 17, 2024

Hey @declandewet thx for reply.

my project base on vue2+vue-router+vuex with SSR bundle by webpack 2.0

i find some intristing...and everything ok... but maybe it's not good
below is my change

before :

App.js

import Vue from 'vue'
import App from '../component/App.vue'
import router from '../router'
import store from '../store'
import { sync } from 'vuex-router-sync'
import * as filter from '../filter'
Object.keys(filter).forEach(key => {
  Vue.filter(key, filter[key])
})
const app = new Vue({
  router,
  store,
  ...App
})
sync(store, router)
export { app, router, store }

/router/index.js

import Vue from 'vue'
import Router from 'vue-router'
import Meta from 'vue-meta'
Vue.use(Router)
Vue.use(Meta)
export default new Router({
  mode: 'history',
  /* istanbul ignore next */
  scrollBehavior: () => ({ y: 0 }),
  routes: [
    { path: '/', component: Index },
    { path: '*', redirect: '/' }
  ]
})

after:

App.js

import Vue from 'vue'
import Meta from 'vue-meta'
Vue.use(Meta)
.
.
.

/router/index.js

import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
.
.
.

from vue-meta.

zspecza avatar zspecza commented on May 17, 2024

Definitely a module resolution problem then - I'll investigate how the ES2015 build (https://github.com/declandewet/vue-meta/blob/7da1a5a72a75926eb431d5cebea30cdad6a715d9/package.json#L60) is compiled

thanks @achen224

from vue-meta.

zspecza avatar zspecza commented on May 17, 2024

For now, you can use this workaround:

import Meta from 'vue-meta/lib/vue-meta.js' // require the ES2015 lib

from vue-meta.

achen224 avatar achen224 commented on May 17, 2024

thanks @declandewet @Atinux

import Meta from 'vue-meta/lib/vue-meta.js' // require the ES2015 lib

is better solution for now

from vue-meta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.