'window is not defined' when importing ScrollMagic
[issue link]I am trying to import ScrollMagic, but receiving the much known window is not defined. As i understand i need to import the library as a plugin and switch off SSR, but unfortunately this is not working.
plugins/scrollmagic.js
import ScrollMagic from 'scrollmagic'
export default ScrollMagic
nuxt.config.js
plugins: [
{
src: '~/plugins/scrollmagic', ssr: false
}
],
views/test-component.vue
<script>
import ScrollMagic from '~/plugins/scrollmagic'
export default {
}
</script>
error:
[vue-router] Failed to resolve async component default: ReferenceError: window is not defined
[vue-router] uncaught error during route navigation:
ReferenceError: window is not defined
