首页 前端知识 Uncaught TypeError: Cannot read properties of undefined (reading ‘call‘) at __webpack_require__3

Uncaught TypeError: Cannot read properties of undefined (reading ‘call‘) at __webpack_require__3

2024-05-24 08:05:05 前端知识 前端哥 19 561 我要收藏

项目场景:


将vite升级到vite4.0之后,使用hls播放m3u8的视频时,报错如下:

Uncaught TypeError: Cannot read properties of undefined (reading 'call')
at __webpack_require__3 (997125ee-68fb-4269-81dd-f71b50571fe8:155:48)
at ./src/demux/transmuxer-worker.ts (997125ee-68fb-4269-81dd-f71b50571fe8:11:66)
at __webpack_require__3 (997125ee-68fb-4269-81dd-f71b50571fe8:155:48)
at webpackBootstrapFunc2 (997125ee-68fb-4269-81dd-f71b50571fe8:207:28)
at 997125ee-68fb-4269-81dd-f71b50571fe8:209:15
复制

解决方案:

方案1

解决方法将vite版本降低(3.2.5)

方案2

// import Hls from "hls.js"
import Hls from 'hls.js/dist/hls.min.js'
复制

ts写法(vite.config.ts)

const alias: Record<string, string> = {
'~/': `${resolve(__dirname, 'src')}/`,
'hls.js': 'hls.js/dist/hls.min.js'
};
复制
转载请注明出处或者链接地址:https://www.qianduange.cn//article/9323.html
评论
发布的文章

JQuery中的load()、$

2024-05-10 08:05:15

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!