Comments (9)
@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.
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.
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.
@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.
Thanks @Atinux - I will look into a fix for this shortly
from vue-meta.
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.
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.
For now, you can use this workaround:
import Meta from 'vue-meta/lib/vue-meta.js' // require the ES2015 lib
from vue-meta.
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)
- Dynamic title in composition API HOT 1
- Question: How to add attributes to <title> tag? HOT 1
- vue-meta or @vueuse/head
- Vue 3: `titleTemplate` no longer working HOT 3
- open a beforeChange hook
- Vue3 + vue-router + vue-meta
- Nuxt 3 `head / head()` vs `useHead()`? HOT 1
- is this project currently in development? HOT 2
- Issue with chrome browser HOT 1
- refresh doesn't respect child's innerhtml=null
- Page transition cause delay in page title change
- Child Meta tags in head() gets added at the bottom of head tag
- VueMetaOptions add changed API
- Vue3+ts+vite - meta name doesn't seem to work HOT 3
- Is this project abandoned? + Alternatives!? HOT 7
- vue-meta in ssr
- bodyAttrs.class is do not expand properly
- Current state of `vue-meta`
- Hot Module Replacement not work
- How to dynamically update "title" and other meta tags? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-meta.