Plyr: A `ReferenceError: _classCallCheck is not defined` error has occurred.

Created on 15 Jun 2020  ·  10Comments  ·  Source: sampotts/plyr

Expected behaviour

no error.

Actual behaviour

A ReferenceError: _classCallCheck is not defined error has occurred.

Steps to reproduce

After executing the

import Plyr from'plyr/dist/plyr.mjs
const player = new Plyr('#player');

code, a ReferenceError: _classCallCheck is not defined error will be reported.

Environment

  • Browser: chrome
  • Version: 83
  • Operating System: mac os
  • Version: 10.15

Console errors (if any)

ReferenceError: _classCallCheck is not defined

I think there is a problem with typeof navigator === "object" && in the first line of the following code (dist/plyr.mjs). After I executed it in the browser console, the _classCallCheck function could not be successfully defined.

typeof navigator === "object" && function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}

Most helpful comment

@WangNingkai

had the same issue, here is workaround that worked for me
import Plyr from "plyr/dist/plyr.polyfilled";

All 10 comments

bump

Bump for PRs 👍

Thanks for the PR. I'll take a look ASAP.

I have the same problem, please release a new version ASAP,thanks 😄

@WangNingkai

had the same issue, here is workaround that worked for me
import Plyr from "plyr/dist/plyr.polyfilled";

@WangNingkai

had the same issue, here is workaround that worked for me
import Plyr from "plyr/dist/plyr.polyfilled";

Great! It works!

@WangNingkai

had the same issue, here is workaround that worked for me
import Plyr from "plyr/dist/plyr.polyfilled";

Such use will cause the final generated code to increase a lot.

Sorry, I’ll try and get a new build out.

On 25 Sep 2020, at 9:16 pm, Hex notifications@github.com wrote:


@WangNingkai

had the same issue, here is workaround that worked for me
import Plyr from "plyr/dist/plyr.polyfilled";

Such use will cause the final generated code to increase a lot.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

While we wait for the new release, a quick (but dirty) workaround is to change your plyr entry in package.json to this:
"plyr": "github:sampotts/plyr#develop"
This will pull it directly from the develop branch of this repo, so it shouldn't be considered a long-term solution.

Really sorry for the delay on getting this out but it's in v3.6.3. I'm working on something which should mean increased development of Plyr and some modernization of the codebase.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomByrer picture tomByrer  ·  3Comments

frumbert picture frumbert  ·  3Comments

onigetoc picture onigetoc  ·  3Comments

nam-co picture nam-co  ·  4Comments

ahmadshc picture ahmadshc  ·  4Comments