There's a Browser.T referenced in the emscripten runtime output of the current published build that doesn't refer to anything as far as I can tell, causing the output of either browserify or webpack to produce the error Uncaught ReferenceError: Browser is not defined.
Rebuilding the library fixes this, but adds an error that encode.js.mem can't be found. Adding Module['readAsync']=function(_,f){f(Module['readBinary']())}; seems to fix this, but then I get Uncaught Error: [ReadHuffmanCode] invalid num_codes or space.
You'd lose the benefits of compressing the memfile, but it may be worth considering switching to emscripten's upcoming SINGLE_FILE flag that does base64 encoding if there's no other workaround. (Is there actually a space advantage to compressing it at this stage vs leaving it to be brotli'd/gzip'd at the same time as the rest of the JS in the user's build pipeline? I'd expect the latter to at least be slightly more CPU-efficient since it'd be decompressed by native code.)
Misc issues:
-
The bro command in the makefile no longer works with the latest brotli; the equivalent command is now brotli -c. (Alternatively, there's always ./vendor/brotli/bin/bro.)
-
NO_BROWSER has been removed from emscripten.
There's a
Browser.Treferenced in the emscripten runtime output of the current published build that doesn't refer to anything as far as I can tell, causing the output of either browserify or webpack to produce the errorUncaught ReferenceError: Browser is not defined.Rebuilding the library fixes this, but adds an error that encode.js.mem can't be found. Adding
Module['readAsync']=function(_,f){f(Module['readBinary']())};seems to fix this, but then I getUncaught Error: [ReadHuffmanCode] invalid num_codes or space.You'd lose the benefits of compressing the memfile, but it may be worth considering switching to emscripten's upcoming
SINGLE_FILEflag that does base64 encoding if there's no other workaround. (Is there actually a space advantage to compressing it at this stage vs leaving it to be brotli'd/gzip'd at the same time as the rest of the JS in the user's build pipeline? I'd expect the latter to at least be slightly more CPU-efficient since it'd be decompressed by native code.)Misc issues:
The
brocommand in the makefile no longer works with the latest brotli; the equivalent command is nowbrotli -c. (Alternatively, there's always./vendor/brotli/bin/bro.)NO_BROWSERhas been removed from emscripten.