michaeldfoley / vue-ssr-drawsvgplugin-error

Illustrates the error that occurs when using the DrawSVGPlugin with vue-server-renderer.
0 stars 0 forks source link

Solution? #1

Open JaredPotter opened 6 years ago

JaredPotter commented 6 years ago

Hello,

I noticed your post for help a long time ago on Greenstock forms. About using nuxt along with DrawSVGPlugin. I'm currently having a hard time getting it to work.

Do you happen to have the solution to this problem so I can use it as a reference?

thanks

michaeldfoley commented 6 years ago

You need to make sure you are not trying to load DrawSVGPlugin during server side render. process.browser should do the trick

import {TimelineMax} from 'gsap';
if (process.browser) {
  require('~/plugins/DrawSVGPlugin');
}
export default {