Repository navigation
Node.js: file paths for load()/fetchFile, require('@ffmpeg/util') (#438, #426, #497) - #956
Draft
lucasgelfond wants to merge 1 commit into
Draft
lucasgelfond wants to merge 1 commit into
lucasgelfond wants to merge 1 commit into
Conversation
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 28, 2026 17:55
bb1a4af to
8de0220
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 28, 2026 18:06
8de0220 to
c65829b
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 28, 2026 18:08
c65829b to
6ba5cda
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 28, 2026 18:27
6ba5cda to
46cb184
Compare
❌ Deploy Preview for ffmpegwasm failed.
|
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 28, 2026 21:43
46cb184 to
8cafcf8
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 28, 2026 21:58
8cafcf8 to
a3d0f6c
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 28, 2026 23:55
a3d0f6c to
9f83dac
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 29, 2026 00:17
9f83dac to
1c219d0
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 29, 2026 00:37
1c219d0 to
7a8e58f
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 29, 2026 00:51
7a8e58f to
419a036
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 29, 2026 01:49
2e920d1 to
c052f4d
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 29, 2026 01:57
c052f4d to
cc91221
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 29, 2026 03:59
cc91221 to
22d508c
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 29, 2026 04:25
22d508c to
3b9f9e0
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 29, 2026 05:47
3b9f9e0 to
e1a4589
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 29, 2026 10:34
e1a4589 to
de739cc
Compare
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 29, 2026 10:49
de739cc to
d872ee2
Compare
In Node.js, ffmpeg.wasm was handed file paths where it expected URLs, and
fetch() can't read them ("TypeError: fetch failed", "Failed to parse URL
from .../ffmpeg-core.wasm": #438, #426, #497).
- load(): coreURL and wasmURL may be file paths, including Windows ones;
they become file: URLs before import() and emscripten see them.
- @ffmpeg/util gets a "node" export whose fetchFile() reads local paths and
file: URLs from disk, and Blobs without FileReader (Node has none).
- require('@ffmpeg/util') never worked in Node: the package is
"type": "module", so dist/cjs was parsed as ESM. dist/cjs is now marked
"type": "commonjs".
- tests/node/paths.test.mjs covers all of the above.
lucasgelfond
force-pushed
the
claude/07-node-paths
branch
from
September 29, 2026 14:52
d872ee2 to
8db13c9
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The other long-standing Node bug family (#438 "Support for Node.js v18", #426, #497): the library assumes URLs, but in Node people pass file paths, so you got
TypeError: fetch failedorFailed to parse URL from …/ffmpeg-core.wasm.load()accepts filesystem paths (including Windows paths) forcoreURL/wasmURL, converting them tofile:URLs beforeimport()and emscripten see them. POSIX absolute paths already happened to work through Node'simport(); Windows paths andwasmURLdid not.@ffmpeg/utilgets anodeexport. ItsfetchFile()reads local paths andfile:URLs from disk, and reads Blobs withoutFileReader, which Node doesn't have. URLs still go throughfetch.require('@ffmpeg/util')has never worked in Node. The package is"type": "module", sodist/cjs/*.jswas parsed as ESM.dist/cjsis now marked"type": "commonjs".Verification:
tests/node/paths.test.mjscovers pathcoreURL,fetchFilewith a path,file:string, URL object and Blob, CJSrequire, and an end-to-end transcode of a file read that way. All 12 Node tests pass.Addresses
require('@ffmpeg/util'): TypeError: Failed to parse URL from /Users/user/Desktop/projects/nestproject/node_modules/@ffmpeg/core/dist/ffmpeg-core.wasm #426, Support for Node.js v18 #438, [cause]: TypeError [ERR_INVALID_URL]: Invalid URL #497 · util UMDexports is not defined: util 12.2 UMD is treated accidentally as ESM #848, FFmpeg UMD not loading in browser — exports is not defined and FFmpeg stays undefined (photo compression works, video fails) #909 (verified in Tests reproducing the open bugs that remain after the stack #968)