Commit 122b922
committed
fix(producer): shim CJS __dirname / __filename in ESM banner
Bundled CJS deps — notably the ffmpeg/Emscripten wasm glue, which does
`scriptDirectory = __dirname + "/"` — were crashing at render time with
`__dirname is not defined in ES module scope`. The existing banner shimmed
`require` from `import.meta.url` but not `__dirname` / `__filename`.
Adds both globals from `import.meta.url` alongside the createRequire shim.
Verified by re-running a producer render after rebuild — ffmpeg pipeline
completes cleanly.1 parent 211e0ad commit 122b922
1 file changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 18 | + | |
22 | 19 | | |
23 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
0 commit comments