Closed
Description
Error occurs when running npm run download
.
Error: TAR_BAD_ARCHIVE: Unrecognized archive format
at Unpack.warn (S:\Documents\OpenSource\ffmpeg.wasm\node_modules\tar\lib\warn-mixin.js:21:40)
at Unpack.warn (S:\Documents\OpenSource\ffmpeg.wasm\node_modules\tar\lib\unpack.js:236:18)
at Unpack.<anonymous> (S:\Documents\OpenSource\ffmpeg.wasm\node_modules\tar\lib\parse.js:83:14)
at Unpack.emit (node:events:530:35)
at [emit] (S:\Documents\OpenSource\ffmpeg.wasm\node_modules\tar\lib\parse.js:313:12)
at [maybeEnd] (S:\Documents\OpenSource\ffmpeg.wasm\node_modules\tar\lib\parse.js:468:17)
at [consumeChunk] (S:\Documents\OpenSource\ffmpeg.wasm\node_modules\tar\lib\parse.js:500:21)
at Unpack.write (S:\Documents\OpenSource\ffmpeg.wasm\node_modules\tar\lib\parse.js:427:25)
at Unpack.end (S:\Documents\OpenSource\ffmpeg.wasm\node_modules\tar\lib\parse.js:548:14)
at Pipe.end (S:\Documents\OpenSource\ffmpeg.wasm\node_modules\tar\node_modules\fs-minipass\node_modules\minipass\index.js:75:17) {
recoverable: false,
file: 'core-mt-0.12.10.tgz',
cwd: 'S:/Documents/OpenSource/ffmpeg.wasm/apps/vanilla-app/public/assets/core-mt',
code: 'TAR_BAD_ARCHIVE',
tarCode: 'TAR_BAD_ARCHIVE'
}
When investigating, I found I wasn't able to locate a version 0.12.10
for core-mt
, making me thing it's the root error. Swapping it to 0.12.9 does resolve this, however when running the project and loading it in Chrome I get the following errors.
Uncaught ReferenceError: exports is not defined
at index.js:1:728
at index.js:1:2954
at index.js:1:197
at index.js:1:201Understand this errorAI
transcode.html:13 Uncaught ReferenceError: FFmpegUtil is not defined
at transcode.html:13:29
The former pointing to, in util...index.js
.
Object.defineProperty(exports, "__esModule", {
value: !0
}),
Activity
sugoidesune commentedon Mar 28, 2025
me too, i didnt manage to use the vite project either...
rina-rgb commentedon Mar 29, 2025
@IronWarrior The issue seems to come from using the UMD version, which were more common in older setups (UMD builds rely on global variables like exports or FFmpegUtil)
Try switching to ESM builds and load them with
type="module"
, and updateumd
toesm
. That way the browser knows how to handle imports correctly.Old
New
rina-rgb commentedon Mar 29, 2025
@sugoidesune Are you building with react-vite? I think the issue is with
core-mt
version mismatched.Could be related to this PR #832.
In the mean time a quick fix could be changing this line in
App.tsx
From
const baseURL = "https://unpkg.com/@ffmpeg/core-mt@0.12.10/dist/esm";
To
const baseURL = "https://unpkg.com/@ffmpeg/core-mt@0.12.9/dist/esm";
IronWarrior commentedon Mar 29, 2025
Excellent, worked perfectly. Thanks very much for your help!
seem like it is working ffmpegwasm/ffmpeg.wasm#854 (comment)
rina-rgb commentedon Apr 30, 2025
Update: Version 0.12.10 of
core-mt
has been published. You can now use it!