nuxt/vue-meta

3.0 SSR document is not defined

fallemand opened this issue · 2 comments

I'm trying to use the new alpha version of vue-meta with Vue3 and SSR.
The problem is that server-side rendering is failing because the exported function relies on the document in SSR.

vue-meta/dist/vue-meta.cjs.js => Why is this file relying on document?

Thanks!

I also meet this problem

It seems that you should call createMetaManager method with argument true.
This will switch the library to SSR-compatible mode:

import { createMetaManager } from 'vue-meta';
...
const metaManager = createMetaManager(true);
...
app.use(metaManager);