xdlumia / vue3-video-play

适用于 Vue3 的 hls.js 播放器组件,配置丰富,界面还算好看
https://codelife.cc/vue3-video-play/
575 stars 96 forks source link

[commonjs--resolver] Failed to resolve entry for package "vue3-video-play". #129

Open maxrks opened 7 months ago

maxrks commented 7 months ago

vite:4.5.0编译报错

[commonjs--resolver] Failed to resolve entry for package "vue3-video-play". The package may have incorrect main/module/exports specified in its package.json.
error during build:
Error: Failed to resolve entry for package "vue3-video-play". The package may have incorrect main/module/exports specified in its package.json.

从node_modules找到package.json,添加了exports后再编译正常。

  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.umd.js",
      "require": "./dist/index.es.js"
    },
    "./*": [
      "./*",
      "./*.d.ts"
    ]
  },
  "typesVersions": {
    "*": {
      "*": [
        "./dist/*",
        "./*"
      ]
    }
  },
maxrks commented 7 months ago

重复问题,按这个可以解决 https://github.com/xdlumia/vue3-video-play/issues/124#issuecomment-1807605217

moyuxitt commented 7 months ago

还是没解决

pure-maple commented 7 months ago

packages.json中的"module": "./dist/index.es.js"改为"module": "./dist/index.mjs"后,可以正常使用

LIFM0623 commented 7 months ago

牛逼 解决了

sea-sugar commented 7 months ago

虽然不知道为什么,但是解决了捏。

threeRiverMoon commented 1 month ago

修改package,本地好了,线上就不行