Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser blockers #20

Closed
buu700 opened this issue Jul 17, 2017 · 13 comments
Closed

Browser blockers #20

buu700 opened this issue Jul 17, 2017 · 13 comments

Comments

@buu700
Copy link

buu700 commented Jul 17, 2017

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.

@fabianmenges
Copy link

Having the same issue...

@philippefutureboy
Copy link

Second this issue, present in Electron app

@sergeyzenchenko
Copy link

Same for me

@serajam
Copy link

serajam commented Dec 14, 2017

+

@mgetz
Copy link

mgetz commented Mar 23, 2018

Getting the same error

@bilalq
Copy link

bilalq commented Apr 18, 2018

This issue also surfaces when transitively loading brotli from a jest test of a purely backend node library.

@vinuel
Copy link

vinuel commented Apr 20, 2018

I also get this error message Uncaught Error: [ReadHuffmanCode] invalid num_codes or space and have no idea what it means ...

@fabianmenges
Copy link

Looks like this project is dead... I switched to LZ4

@buu700
Copy link
Author

buu700 commented Apr 20, 2018

I've been using LZ4 (npm package lz4) as well.

@kucukkanat
Copy link

Yapacağınız işi sikeyim kusura bakmayın

@pimterry
Copy link

One note that might be useful to others: this only affects the compress build, not the decompress build. require('brotli') or require('brotli/compress') fail for me, but require('brotli/decompress') works fine, and that's all I need for my case anyway.

@devongovett
Copy link
Member

At this point, we could probably consider WASM as the compile target instead. I guess we could keep a fallback for IE 11 as well but all the modern browsers have WASM now. https://caniuse.com/#feat=wasm

@devongovett
Copy link
Member

Now uses wasm #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests