saberland/saber

'Window is not defined' where to place client-side only scripts? #466

ohiosveryown posted onGitHub

I'm trying to use a third-party plugin (flickity) but I'm getting an error when the app tries to build: window is not defined. I initialized the plugin on the mount lifecycle fwiw.

I'm guessing this is because saber/vue is trying to run the plugin while rendering to the page on the server.

Any thoughts?


You probably need to require it in mounted as well.

posted by egoist over 5 years ago

hmm, still getting ReferenceError: window is not defined

posted by ohiosveryown over 5 years ago

Going to try and roll my own instead of using a third-party. FWIW future folks, Embla seems to work fine.

posted by ohiosveryown over 5 years ago

Fund this Issue

$0.00
Funded

Pull requests