ffmpegwasm / ffmpeg.wasm

FFmpeg for browser, powered by WebAssembly
https://ffmpegwasm.netlify.app
MIT License
14.22k stars 831 forks source link

worker.js is not found #558

Closed mm-bt closed 1 year ago

mm-bt commented 1 year ago

Describe the bug vue3+vite 项目,安装0.12的版本,本地跑项目的时候,出现worker.js找不到,如下

"node_modules/.vite/deps/worker.js?type=module&worker_file" is not found

@ffmpeg/core": "^0.12.2", "@ffmpeg/ffmpeg": "^0.12.4", "@ffmpeg/util": "^0.12.0",

vue+vite

源码这个地方有问题, image

只有build的时候才会生成worker.js才能跑起来,希望作者大大解决下

thalleshonorato commented 1 year ago

If you use vite I had the same problem and I solved it by adding config below in vite.config.ts

optimizeDeps: { exclude: ["@ffmpeg/ffmpeg", "@ffmpeg/util"], },

I recommend following the example following all the configs in the example

jeromewu commented 1 year ago

Thanks @thalleshonorato for answering this issue!