question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with got decompressResponse is not a function

See original GitHub issue

When I use any method that has some kind of http request, I get the following error:

Type Error: decompressResponse is not a function

Here is my code:

import { Installer } from "@xmcl/installer";
import path from "path";

(async () => {
	const temp = await Installer.getVersionList();
	const app = remote.app;
	await Installer.install("client", temp.versions[0], path.join(app.getPath("userData"), "./game/"));
})();

Edit Auth module still seems to work because if I recall correctly, it uses window.fetch instead of got.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ci010commented, Mar 6, 2020

What does the browser field in package.json do? This seems to fix the issue on Windows but I still have the issue on Linux.

In node_modules/got/package.json:

{
  "browser": { "module-name": true/false }
}

If the module-name is false, webpack will ignore it in bundle. It should work for all the platform, as it’s the behavior of webpack…

1reaction
ci010commented, Mar 4, 2020

Actually, I have propose a PR to fix. It just a guide to migrate to new API. You don’t need to merge it.

For the decompressResponse is not a Function, currently, you have to modify the package.json of got js… Or wait it publish new version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gzip seems not work in my project · Issue #945 - GitHub
In get-response.js. const decompressResponse = require('decompress-response');. decompressResponse is not a function but a empty object.
Read more >
How do I ungzip (decompress) a NodeJS request's module ...
The request body was encoded to utf8 (response.setEncoding('utf8')) prior to reading the body. However, it does not seem to make a difference. I ......
Read more >
Uncaught TypeError: this.decompress is not a function
I am having this error 4 times when opening the webGL website, it is should be caused by failure to decompress ".unityweb" files....
Read more >
gzip — Support for gzip files — Python 3.11.1 documentation
The GzipFile class reads and writes gzip-format files, automatically compressing or decompressing the data so that it looks like an ordinary file object....
Read more >
Request Config | Axios Docs
Requests will default to GET if method is not specified. ... `transformResponse` allows changes to the response data to be made before //...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found