Expected behaviour
using import svgUrl from 'plyr/dist/plyr.svg'; to use the bundled icons SVG sprite was possible before plyr v3.8.0.
Actual behaviour
using import svgUrl from 'plyr/dist/plyr.svg'; produces this error in webpack:
ERROR in ./app/components/VideoPlayer/VideoPlayer.tsx 4:0-40
Module not found: Error: Package path ./dist/plyr.svg is not exported from package /projects/my-project/node_modules/plyr (see exports field in /projects/my-project/node_modules/plyr/package.json)
Steps to reproduce
- install plyr v3.8.4
- add code
import svgUrl from 'plyr/dist/plyr.svg';
const player = new Plyr(someDomNode, {
loadSprite: false,
iconUrl: svgUrl,
});
- bundle app with webpack (or vite as it should generate a similar problem)
Environment
Possible Solution
Add plyr/dist/plyr.svg to the exports field in the package.json.
Expected behaviour
using
import svgUrl from 'plyr/dist/plyr.svg';to use the bundled icons SVG sprite was possible before plyr v3.8.0.Actual behaviour
using
import svgUrl from 'plyr/dist/plyr.svg';produces this error in webpack:Steps to reproduce
Environment
Possible Solution
Add
plyr/dist/plyr.svgto the exports field in thepackage.json.