sampotts / plyr

A simple HTML5, YouTube and Vimeo player

Home Page:https://plyr.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issue with Plyr on Mac

andrey-sylka opened this issue · comments

Hello, cant find similar issue in internet but i have got this error

ReferenceError: document is not defined
    at /Users/*******/node_modules/plyr/dist/plyr.js:302:21
    at /Users/*******/node_modules/plyr/dist/plyr.js:311:5
    at /Users/*******/node_modules/plyr/dist/plyr.js:2:83
    at Object.<anonymous> (/Users/*******/node_modules/plyr/dist/plyr.js:5:3)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)

And it is happened only on Mac. On Windows computer all works fine
We are try to use Plyr with svelte
and problem with the import
import Plyr from "plyr";
we install plyr as npm package
It can be fixed with lazy loading, for example import it in onMount, to be sure that it runs in browser. but it is weird that it works differently on Mac and Windows

Thank you in advance if someone can help with any ideas...