-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
Fix Electron usage #899
Comments
For GET requests, I get the following error :
with
It is working if I remove |
It is probably linked to a recent (undocumented) change in electron@7 where setting content-length explicitly fails : electron/electron#21091 |
(I have the same issue on |
@arantes555 thanks for the heads up :) |
@szmarczak it turns out, in this specific case, it is indeed a breaking change in electron's API but not a bug per-say. You just cannot set explicitly a |
Ok, so I have made progress on this: Things that do not work:
Things that can be fixed:
TODO (applies only when using electron):
You can see my work here. |
@szmarczak Honestly, I would prefer us opening an Electron issue about these differences instead of littering the codebase with workarounds. Electron says it's Node.js compatible, so it's up to them to fix it. |
@sindresorhus @szmarczak I believe there are PRs in electron that will fix most of these issues :
I suggest waiting until these are merged, and electron@7.2 is released with these fixes. |
And for anything not fixed by those PRs or doesn't have an existing issue, we should open new Electron issues for. |
Haven't |
@szmarczak they had it, they broke it ^^ electron@7 broke a lot of things in |
Every single Electron release breaks a lot of random things... |
This comment has been minimized.
This comment has been minimized.
@vbourgeois We are aware that electron support is broken as of now - it's because electron is not compatible with the Node.js |
I have made more progress: ✖️ will send a PR in 10 mins |
@szmarczak At this point, is it really worth all the effort? Electron will continue to break things and be incompatible. I feel like this is a losing battle. Electron support was only added because the Electron team said the |
@sindresorhus I agree. Sent a PR - it will also display a deprecation warning. I think we should drop Electron support in a minor release, as it's been broken since Got v9. Or we can just drop it now. |
@szmarczak I don't think we should drop it completely as it might work for people in some scenarios, and dropping it would be a breaking change. However, what we can do is to remove the docs for the Electron option and mention of Electron support, except the FAQ thing. And then open an issue about removing it completely in Got v11. |
Hey @sindresorhus This got sent my way, just wanted to check in here RE in
I haven't checked the history of our docs but our current
We made the API close so that the super simple "request a thing from URL(X)" work across I think dropping support here is the right move as they are fundamentally not API compatible and trying to make it look to users like they are will just result in weird bugs / issues for all involved. There are also lots of options to If there's a part of our docs that I've missed that does erroneously claim compatibility let me know and I will gladly scrub it or reword it 👍 |
@MarshallOfSound It was removed here: electron/electron@8ea33d6#diff-4193de697f9ec0a7a4b858cb1a6ea968L24-L25 by my request: electron/electron#8117 (comment) |
Only the |
Perfect, thank you very much for the clarification! |
Describe the bug
When using got in electron, useElectronNet option is not working with electron 7 for POST requests, returns
net::ERR_INVALID_ARGUMENT
error.Actual behavior
HTTP request returns the following error :
Expected behavior
Correct HTTP response
Code to reproduce
In electron main or renderer process :
The text was updated successfully, but these errors were encountered: