clappr / clappr-level-selector-plugin

Clappr Level Selector Plugin
MIT License
76 stars 56 forks source link

Import in react causes error: "ReferenceError: installedModules is not defined" #101

Open adam-ducker opened 3 years ago

adam-ducker commented 3 years ago

I'm using Clappr in React 16.13.1. The player renders fine without plugins and renders as expected when I'm using other plugins including clappr-playback-rate-plugin, clappr-chromecast-plugin, and clappr-audio-selector-plugin. But for some reason when I import like this I get the error:

import LevelSelector from 'clappr-level-selector-plugin';

From package.json:

    "clappr": "^0.3.13",
    "clappr-audio-selector-plugin": "^0.1.37",
    "clappr-chromecast-plugin": "^0.1.1",
    "clappr-level-selector-plugin": "^0.2.1",
    "clappr-playback-rate-plugin": "^0.6.0",

Error:

ReferenceError: installedModules is not defined
(anonymous function)
node_modules/clappr-level-selector-plugin/dist/level-selector.js:44
  41 | /******/     __webpack_require__.m = modules;
  42 | /******/
  43 | /******/     // expose the module cache
> 44 | /******/     __webpack_require__.c = installedModules;
  45 | /******/
  46 | /******/     // define getter function for harmony exports
  47 | /******/     __webpack_require__.d = function(exports, name, getter) {
mayur-keswani commented 2 years ago

Hello adam, Have you solved this issue? it seems like the plugin is not compatible with the current clappr version.

mrbar42 commented 1 year ago

the built code that is published to npm seem to contain an error in dist/levels-selector.js

/******/    // The module cache
/******/    var installedModuleds = {};

instead of

/******/    // The module cache
/******/    var installedModules = {};