videojs / videojs-vr

A plugin to add 360 and VR video support to video.js.
https://videojs-vr.netlify.com/
MIT License
541 stars 143 forks source link

Can't get this to work on Nuxt 3 #287

Open hkleow opened 5 months ago

hkleow commented 5 months ago

Can't get this plugin to work on nuxt 3. I've tried these import "videojs-vr"; import "videojs-vr/dist/videojs-vr.js"; import "videojs-vr/dist/videojs-vr.min.js";

it will return error ERROR return [nuxt] [request error] [unhandled] [500] Cannot use import statement outside a module

ERROR: return navigator is not defined

i've included codesandbox https://codesandbox.io/p/github/hkleow/videojsvrdemo/

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. https://codesandbox.io/p/github/hkleow/videojsvrdemo/

Results

Expected

Please describe what you expected to see.

Actual

Please describe what actually happened.

Error output

If there are any errors at all, please include them here.

ERROR return [nuxt] [request error] [unhandled] [500] Cannot use import statement outside a module

ERROR: return navigator is not defined

Additional Information

Please include any additional information necessary here. Including the following:

versions

videojs

what version of videojs does this occur with? "video.js": "^8.10.0",

browsers

what browser are affected?

OSes

what platforms (operating systems and devices) are affected?

plugins

are any videojs plugins being used on the page? If so, please list them below. no plugin only videojs-vr