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

Electron app error: Failed to execute 'fetch' on 'Window': member signal is not of type AbortSignal. #5143

Closed
gamaya-developer opened this issue Sep 15, 2019 · 14 comments · Fixed by #9880
Assignees
Labels
Azure.Core bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization.
Milestone

Comments

@gamaya-developer
Copy link

gamaya-developer commented Sep 15, 2019

issue appears in electron render process, because '@azure/core-http' use global variable for fetch() and it's replaced. Window(global object for electron) has 'fetch' as well. Possible fix for file


const fetch = require("node-fetch");

@loarabia loarabia added Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. labels Sep 17, 2019
@michaeljqzq
Copy link
Contributor

Hi @daviwil , this is an issue regarding core-http library. Could you take a look? Thanks

@michaeljqzq michaeljqzq removed the Mgmt This issue is related to a management-plane library. label Sep 18, 2019
@ramya-rao-a ramya-rao-a added this to the [2020] February milestone Dec 16, 2019
@bterlson
Copy link
Member

I have tested various electron app configurations running the sdk in both render and main process. However, I was using a bundler, which ensured the code I ran in the main process was bundled for node, and code running in the render process was bundled for web. Thus, the render process code would never try to use node-fetch.

@gamaya-developer if you're still around, it might be helpful to say more about how you're building your app, and whether bundling is an option for you. It's also possible things have gotten better in the meantime!

@gamaya-developer
Copy link
Author

gamaya-developer commented Dec 16, 2019

Hi @bterlson! I think the main reason of issue is approach to use node.js in angular services. You can check boilerplate https://github.com/maximegris/angular-electron, the file where is the conditional import is https://github.com/maximegris/angular-electron/blob/master/src/app/core/services/electron/electron.service.ts.

In my case I have to import azure package inside conditional import to use node.js only available features for blob.
In my case I overcame the issue to import node-fetch before azure package.

@xirzec
Copy link
Member

xirzec commented Feb 11, 2020

@gamaya-developer Sorry for the slow reply, but are you happy with your workaround for now?

@daviwil @bterlson perhaps we should consider not using the global ref for fetch and use the import value, since this codepath is node-only anyway? The docs seem to indicate this may be a good idea: https://www.npmjs.com/package/node-fetch#loading-and-configuring-the-module

@xirzec xirzec modified the milestones: [2020] February, Backlog Feb 11, 2020
@bterlson
Copy link
Member

I think in any case we should not be relying on global mutation, so I support import fetch from 'node-fetch'.

@jssuttles
Copy link

Is there a temporary workaround for this issue? I'm running into this while using nwjs as well (https://github.com/nwjs/nw.js)

@ramya-rao-a ramya-rao-a added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jul 19, 2020
@xirzec
Copy link
Member

xirzec commented Jul 21, 2020

@jssuttles do you have a repro for this that we can try with the fix in #9880 ?

@jssuttles
Copy link

@xirzec
Copy link
Member

xirzec commented Jul 21, 2020

@jssuttles thank you!

@jeremymeng can you verify your PR against this?

@jeremymeng
Copy link
Member

Thanks @jssuttles for the repro. I am on it.

@jeremymeng
Copy link
Member

Yup, the issue is fixed by #9880

image

@Petermarcu
Copy link
Member

Should this come out of the backlog and into a milestone? When are we targeting a release of this change?

@jeremymeng jeremymeng modified the milestones: Backlog, [2020] August Jul 30, 2020
@jeremymeng
Copy link
Member

We are planing to include a fix in the next release of core-http.

@jeremymeng
Copy link
Member

August 2020 release that is.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants