mirror of
https://github.com/google/brotli.git
synced 2026-09-22 22:56:08 +00:00
TypeError in decode.min.js #372
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @stefanloerwald on GitHub (Feb 7, 2021).
Hi, I've just downloaded decode.min.js and integrated it into my app according to the these Microsoft docs.
I get a
TypeError: e.Q is not a function.When pretty-printing the file in dev-tools, the error is in this section of the file:
Is this a problem with the minified JS file or with the code calling it?
The code that interacts with brotli is this:
@stefanloerwald commented on GitHub (Feb 10, 2021):
I had a deeper look into the javascript and the minified version is obviously invalid: The corresponding code unminified is:
There is exactly one call to this method, and it's four lines further down:
So it's obvious, that the first arg to the method is of type
Int8Array. The minifier replacedsetbyQ, which is nonsense. So this was created by an overly aggressive minifier.The attached minified version was generated using the following Dockerfile:
Until the actual build pipeline for these files is fixed, I'd suggest to simply replace the files with the ones attached.
BR
Stefan
(Note: a previous version of this comment incorrectly stated that there was unused code in the JS file. I apologise for this mistake. However, the analysis that the minified file is not working still stands)
@stefanloerwald commented on GitHub (Jun 4, 2021):
It's been months on this topic without any response. I must say I find it bizarre that such a trivially fixable issue isn't even responded to. Clearly other people are affected too. Please just use a non-broken minifier to produce a correct version of your code.
Thanks
Stefan
@eustas commented on GitHub (Jun 24, 2021):
Hello. Sorry for the super-long delay. Could you, please, check that decode.min.js works for you now?
@eustas commented on GitHub (Jun 24, 2021):
Important: now decode.js / decode.min.js is a module; so the updated usage example looks like this:
@stefanloerwald commented on GitHub (Jun 25, 2021):
Hi @eustas,
I can confirm that the new version works. Thank you.
Best regards
Stefan