首页 前端知识 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 前端知识 前端哥 6 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
评论
发布的文章

用JS生成本周日期代码

2024-04-18 17:04:15

js 递归函数

2024-05-31 10:05:46

jQuery是什么?如何使用?

2024-03-12 01:03:24

js延迟加载的六种方式

2024-05-30 10:05:51

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