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

[1.3.2] Usage with Nuxt / document is not defined

Open zsavajji opened this issue 7 years ago β€’ 6 comments

Hi, i've been using vue-popper with nuxt for a while with success, but this morning i upgraded the dependencies of my project, and updated to 1.3.2 from 1.3.0, and suddenly this error appears when rendering from the server.

ReferenceError: document is not defined at __vue_create_injector__ (/node_modules/vue-popperjs/dist/js/vue-popper.js:354:16)

Is this a bug or there's some new configuration for SSR which i'm missing out?

Thanks in advance

zsavajji avatar May 14 '18 14:05 zsavajji

Hi @Zsavajji I think problem in rollup-plugin-vue I downgrade plugin Please check 1.3.3 version

RobinCK avatar May 14 '18 16:05 RobinCK

Yes, sorry, never got back to you, 1.3.3 is working as expected!

zsavajji avatar May 20 '18 16:05 zsavajji

Hi @RobinCK Same error appears since version 1.4.1

ayvanov avatar Oct 02 '18 09:10 ayvanov

+1

shlima avatar Dec 29 '18 07:12 shlima

I can confirm, that using raw version from /src/component/popler.js.vue works perfect with SSR. @RobinCK could you please fix the issue ?

shlima avatar Dec 29 '18 11:12 shlima

@RobinCK if you add the following line to webpack config:

globalObject: 'typeof self !== \'undefined\' ? self : this'

You package will be working in SSR mode, please see https://github.com/webpack/webpack/issues/6784#issuecomment-375941431

Could you please fix the issue?

shlima avatar Feb 27 '19 09:02 shlima