SevenOutman / vue-aplayer

:cake: Easy-to-use music player for Vue 2.x
https://vue-aplayer.js.org
MIT License
1.32k stars 200 forks source link

document is not defined In NUXT JS #35

Closed mbengchan closed 6 years ago

mbengchan commented 6 years ago

When i import the plugin in a Nuxt.js page i get a document not defined. Can these plugin work in SSR for example Nuxt.js

mbengchan commented 6 years ago

I solved my own problem. created a new plugin under the nuxt plugins directory and added the plugin to the nuxt.config.js file and disabled server-side-rendering option { src: '~plugins/vue-aplayer', ssr: false }, everything is working fine now

SevenOutman commented 6 years ago

@Shadomax Glad you have solved it! Vue-APlayer has not been tested out with SSR, but I believe audio element does not work well with SSR.

smilingpeanut commented 6 years ago

I tried this same method and the document error is still occurring. Any thoughts @SevenOutman?

SevenOutman commented 6 years ago

@smilingpeanut As explained before, Vue-APlayer probably doesn't work with SSR.

smilingpeanut commented 6 years ago

Right, I totally get that. But with SSR off as in the previous comment, the bug is still occurring.

On Jun 6, 2018, 5:37 PM -0600, Doma notifications@github.com, wrote:

@Shadomax As explained before, Vue-APlayer probably doesn't work with SSR. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

SevenOutman commented 6 years ago

@smilingpeanut Well I'll look into it.