1

When I installed shaka player in Nuxt and mode: universal, I received this error:

enter image description here

In spa mode shaka is working but in universal it doesn't work.


Thanks to the answer, the issue was solved with the following:

if (process.client) {
  window.shaka = require('shaka-player/dist/shaka-player.compiled.js')
  require('shaka-player/dist/shaka-player.ui')
}
kissu
  • 40,416
  • 14
  • 65
  • 133
Iman
  • 439
  • 6
  • 15
  • Please check this on for `mode` tho: https://stackoverflow.com/q/68272663/8816585 As this is currently deprecated. – kissu Jul 06 '21 at 15:00

1 Answers1

1

You did not provided any code, but I'm 90% sure that this is coming from the fact that window is not present when run on the server.

My answer can be found here: How to fix navigator / window / document is undefined in Nuxt

kissu
  • 40,416
  • 14
  • 65
  • 133