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

3.0 SSR document is not defined

Open fallemand opened this issue 3 years ago • 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!

fallemand avatar May 20 '22 12:05 fallemand

I also meet this problem

liuweiwalliam avatar Jul 07 '22 06:07 liuweiwalliam

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);

Alexis2004 avatar Jul 21 '22 09:07 Alexis2004