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

Stops working in Electron as of v5.0.0 #112

Closed
tribou opened this issue May 29, 2018 · 8 comments
Closed

Stops working in Electron as of v5.0.0 #112

tribou opened this issue May 29, 2018 · 8 comments

Comments

@tribou
Copy link

tribou commented May 29, 2018

Hi!

I'm trying to share code across a web app and Electron, and it's been working great on v4. However, when I try to upgrade this package in the Electron app from v4.1.0 to v5.0.0 (or later), all of the network calls silently stop working. v5 appears to still work in the web app with the exact same API code.

Has anyone else gotten version v5.0.0 or later to work with Electron?

@qubyte
Copy link
Owner

qubyte commented May 29, 2018

The one thing which I suspect is making an issue for you is this line.

Edit: Not sure where I was reading webpack. A reduction would still help though!

@tribou
Copy link
Author

tribou commented May 29, 2018

Ah, I thought that was the culprit as well until yesterday when I noticed that v5.0.1 wasn't working either even though it has the previous version of that logic here. So now I'm wondering if it is somehow the upgrade to node-fetch@v2.0.0...even though that doesn't make as much sense as the line you referenced.

Let me see if I can get a couple example branches up to compare. Unfortunately, it's a pretty large app at the moment. Also, I believe it's still on webpack v3 if that helps at all.

@tribou
Copy link
Author

tribou commented May 29, 2018

After "unmasking" my API helpers, I was able to log the error:

image

And this is fetch-node.js:15.

Any thoughts?

@qubyte
Copy link
Owner

qubyte commented May 29, 2018

It's not possible to know what's going on without a little more information. Is this running in Node or in a BrowserWindow? I don't know much about electron, but I suspect you want the browser half of fetch ponyfill rather than the Node half. Try using require('fetch-ponyfill/build/fetch-browser.js') and see if you get any further with that.

If that doesn't work for you, then a modern enough electron (which would still be quite old) will support genuine fetch out of the box. If you're fetching in Node, then this module delegates to fetch-node anyway, which might be a better option for you.

@qubyte
Copy link
Owner

qubyte commented May 29, 2018

This may also be pertinent: electron/electron#1574

@qubyte
Copy link
Owner

qubyte commented Jun 27, 2018

@tribou How did you get on?

@tribou
Copy link
Author

tribou commented Jun 28, 2018

My apologies, I didn't make much more progress. I've still got v4.1.0 pinned for now until I can find time to debug more.

@qubyte qubyte closed this as completed Jul 8, 2019
@d-fischer
Copy link
Contributor

d-fischer commented Feb 19, 2020

This seems to still be an issue.

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

3 participants