You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
locateFile() not called for .js with EXPORT_ES6 #22508
The problem is allocateUnusedWorker() is not calling locateFile() (as findWasmBinary() does) making it hard to customize the URL. Please enhance allocateUnusedWorker() to call locateFile() before constructing .js url
This is kind of unfortunate. Ideally we would just use new URL(import.meta.url) since we know we are trying to load the same file that is currently running.... however that apparently breaks bundlers. See #22140.
I wonder if we need a new settings such as BUNDLER_FRIENDLY here since by default it would be really nice to just use new URL(import.meta.url) when we know we want to load ourselves.
In my case, I am not using a standard https://... url, but a blob:https:// url as the main js. Same blob url I would like to use inside allocateUnusedWorker() to avoid any possible network related slow downs.
In my case, I am not using a standard https://... url, but a blob:https:// url as the main js. Same blob url I would like to use inside allocateUnusedWorker() to avoid any possible network related slow downs.
The same to me. I must add Module["locateFile"] function manually.
Does new URL with import.meta.url not include the blob:https:// part? What is import.meta.url in your case?
Does new URL with import.meta.url not include the blob:https:// part? What is import.meta.url in your case?
I referred to the code of https://github.com/ffmpegwasm/ffmpeg.wasm, passed the workerURL through mainScriptUrlOrBlob in the worker, and then rewrote Module["locateFile"] to obtain the file. So in multithreaded mode and with Export_ES6 added during compilation, I hope that in the allocateUnusedWorker function, the worker address can still be obtained through theModule["locateFile"]
Activity
sbc100 commentedon Sep 5, 2024
This is kind of unfortunate. Ideally we would just use
new URL(import.meta.url)since we know we are trying to load the same file that is currently running.... however that apparently breaks bundlers. See #22140.I wonder if we need a new settings such as
BUNDLER_FRIENDLYhere since by default it would be really nice to just usenew URL(import.meta.url)when we know we want to load ourselves.jozefchutka commentedon Sep 6, 2024
In my case, I am not using a standard
https://...url, but ablob:https://url as the main js. Same blob url I would like to use insideallocateUnusedWorker()to avoid any possible network related slow downs.TingShine commentedon Dec 4, 2024
The same to me. I must add
Module["locateFile"]function manually.sbc100 commentedon Dec 4, 2024
Does
new URLwithimport.meta.urlnot include theblob:https://part? What isimport.meta.urlin your case?TingShine commentedon Dec 4, 2024
I referred to the code of https://github.com/ffmpegwasm/ffmpeg.wasm, passed the workerURL through mainScriptUrlOrBlob in the worker, and then rewrote
Module["locateFile"]to obtain the file. So in multithreaded mode and with Export_ES6 added during compilation, I hope that in theallocateUnusedWorkerfunction, the worker address can still be obtained through theModule["locateFile"]