-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The contrib-eme plugin does not load correctly #222
Comments
@wetteyve just to let you know that I was unable to reproduce the problem with Steps to reproduceMy yarn environment is very sketchy...
Hintsyarn |
Side note, to fix the yarn permission issue : |
@wetteyve I went old school with the version of yarn I already had installed on my machine, and apparently I was forced to use |
@wetteyve I have a workaround that lets you use the player while waiting for the fix. It's a bit ugly and there is no type hinting, but it works. import '../node_modules/@srgssr/pillarbox-web/dist/pillarbox.umd.js';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const player = Pillarbox('player'); |
@wetteyve For some reason it seems that yarn cannot deduplicate the In the meantime you can use @amtins workaround or point yarn to the good version by adding this to the package.json: "resolutions": {
"video.js": "8.11.1",
"videojs-contrib-eme": "3.11.2"
} I have a working example here: https://github.com/jboix/yarn-pillarbox |
@jboix thanks for the update, i continue my work by adding the resolutions for now 👍 |
After further investigation this is what I found. OverviewUsing Specific IssuesThe core of the problem lies in two cyclic dependencies involving
Both cyclic dependencies are problematic, but the first one is particularly troubling because it involves both a
ExampleSee here a minimal yarn project demonstrating the issue: jboix/vjs-yarn. Upon inspecting the project in a browser, it becomes evident that two distinct versions of video.js are loaded, as showcased below: One critical side effect of this results in the mport videojs from "video.js";
import 'videojs-contrib-eme';
// This line fails
console.log(videojs.getPlugin('eme').VERSION); The error: Proposed Solutions
WorkaroundWhen integrating the project with yarn force the version resolution by adding this to the package.json: "resolutions": {
"video.js": "8.11.8"
} |
Updates the known issues documentation to address the problem of Yarn installing multiple versions of `video.js`, unlike npm. See #222.
Updates the known issues documentation to address the problem of Yarn installing multiple versions of `video.js`, unlike npm. See #222.
Description
When a react application is created with vite, the
videojs-contrib-eme
plugin does not seem to load correctly.How to reproduce
npm create vite@latest pillarbox-react-ts -- --template react-ts
pillarbox-react-ts
npm run dev
pwb.tsx
in thesrc
folder and paste the code belowHints
v18.19.1
v10.2.4
The text was updated successfully, but these errors were encountered: