ffmpegwasm / ffmpegwasm/ffmpeg.wasm

Using vite + vue: `TypeError: Cannot read from private field`

Open
#687 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
C
Stars
17.8k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I am receiving this error when trying to use this library:
> Loading ffmpeg-core.js
> Uncaught (in promise) TypeError: Cannot read from private field

![image](https://github.com/ffmpegwasm/ffmpeg.wasm/assets/349311/56540839-e4a3-4596-a27a-e1ec383c8d0f)

**To Reproduce**
I am using a slightly modified version of https://github.com/ffmpegwasm/ffmpeg.wasm/blob/main/apps/vue-vite-app.
```js
const baseURL = 'https://unpkg.com/@ffmpeg/core-mt@0.12.6/dist/esm'
const videoURL = 'https://raw.githubusercontent.com/ffmpegwasm/testdata/master/video-15s.avi'

async compressVideo() {
console.log('Loading ffmpeg-core.js');

this.ffmpeg.on('log', ({ message }: LogEvent) => {
console.log(message)
})

await this.ffmpeg.load({
coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`, 'text/javascript'),
wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`, 'application/wasm'),
workerURL: await toBlobURL(`${baseURL}/ffmpeg-core.worker.js`, 'text/javascript')
})

console.log('Start transcoding');

await this.ffmpeg.writeFile('test.avi', await fetchFile(videoURL))
await this.ffmpeg.exec(['-i', 'test.avi', 'test.mp4'])

console.log('Complete transcoding');

const data = await this.ffmpeg.readFile('test.mp4')

this.uploadFile(new Blob([(data as Uint8Array).buffer], { type: 'video/mp4' }));
},
```

**Desktop (please complete the following information):**
- OS: macOS 13.6.2
- Browser Chrome
- Version 121

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.