Skip to content

'plyr/dist/plyr.svg' not exported anymore since v3.8.0+ #2886

Description

@jansepke

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

  1. install plyr v3.8.4
  2. add code
import svgUrl from 'plyr/dist/plyr.svg';

const player = new Plyr(someDomNode, {
  loadSprite: false,
  iconUrl: svgUrl,
});
  1. bundle app with webpack (or vite as it should generate a similar problem)

Environment

  • Version: 3.8.4

Possible Solution

Add plyr/dist/plyr.svg to the exports field in the package.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions