关于在uni-app vue3模式下动态引入 recorder-core.js 实例化时出现Recorder is not a constructor的问题
Closed this issue · 2 comments
HuangFeiPeng commented
const Recorder = await import('@/recorderCore/src/recorder-core');
await import('@/recorderCore/src/engine/mp3');
await import('@/recorderCore/src/engine/mp3-engine');
console.log(
'>>>>>Recorder',
new Recorder({
type: 'mp3',
})
);
您好 请问这种使用方法是存在什么问题吗,引入在实例化的时候出现了
Uncaught (in promise) TypeError: Recorder is not a constructor
这种类型的错误,还请指点一二,万分感谢!
HuangFeiPeng commented
new Recorder.default({
type: 'mp3',
})
试了一下 .default 也有同样的情况
Recorder.default is not a constructor
HuangFeiPeng commented
改为 :
new window.Recorder({
type: 'mp3',
})
已解决。