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
The JS main file uses if (typeof window === 'undefined') to check if we're in a browser or Node.js environment...
In a web worker, the window property doesn't exists, juste like the global object (used by Node.js)
And the same test is used in the init function to load the WASM bytecode so just like previously, it doens't work in web workers...
As a workaround, I updated and rebuilt the library after
removing condition to the first polyfill bloc and using globalThis instead of global to
The JS main file uses
if (typeof window === 'undefined')
to check if we're in a browser or Node.js environment...In a web worker, the
window
property doesn't exists, juste like theglobal
object (used by Node.js)And the same test is used in the init function to load the WASM bytecode so just like previously, it doens't work in web workers...
As a workaround, I updated and rebuilt the library after
globalThis
instead ofglobal
tofs.readFileSync
existence in theinit
main function and keep on usingglobalThis
It's not the cleaner way to fix this issue and I don't have much time to spend on this but hey... it works this way. 😅
The text was updated successfully, but these errors were encountered: