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

Do not ignore decompress-response when bundling #1105

Merged
merged 1 commit into from Mar 4, 2020
Merged

Do not ignore decompress-response when bundling #1105

merged 1 commit into from Mar 4, 2020

Conversation

ci010
Copy link
Contributor

@ci010 ci010 commented Mar 4, 2020

Currently, using got with webpack to build target electron-renderer will throw an error from get-response.js like:

decompressResponse is not a Function

The root cause is webpack ignoring the decompress-response module in got, according the browser setting in package.json.

Like the issue #945 described, after removing this field, the webpack will bundle this module and got works correctly.

Checklist

  • I have read the documentation.
  • I have included a pull request description of my changes.
  • I have included some tests.
  • If it's a new feature, I have included documentation updates.

@szmarczak
Copy link
Collaborator

Electron support has been deprecated and will be completely removed in Got 11

@ci010
Copy link
Contributor Author

ci010 commented Mar 4, 2020

Electron support has been deprecated and will be completely removed in Got 11

I'm not sure if I understand this right. Is this mean the removal of "browser" fields is already planned in Got 11, and I can just wait the Got 11 release?

From my understanding, the deprecation of electron means Got does not support for electron net module, but it should still works in electron-renderer with nodeIntegration enabled (using node http/https modules).

This field just makes the webpack bundle wrongly, and Got will not work even if the nodeIntegration is enabled in electron-renderer.

@szmarczak szmarczak changed the title Fix webpack ignore for decompress-response Do not ignore decompress-response when bundling Mar 4, 2020
@szmarczak szmarczak merged commit 88f973f into sindresorhus:master Mar 4, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants