-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Comments
Hi @daviwil , this is an issue regarding core-http library. Could you take a look? Thanks |
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! |
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. |
@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 |
I think in any case we should not be relying on global mutation, so I support |
Is there a temporary workaround for this issue? I'm running into this while using nwjs as well (https://github.com/nwjs/nw.js) |
@jssuttles do you have a repro for this that we can try with the fix in #9880 ? |
@jssuttles thank you! @jeremymeng can you verify your PR against this? |
Thanks @jssuttles for the repro. I am on it. |
Yup, the issue is fixed by #9880 |
Should this come out of the backlog and into a milestone? When are we targeting a release of this change? |
We are planing to include a fix in the next release of core-http. |
August 2020 release that is. |
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
azure-sdk-for-js/sdk/core/core-http/lib/nodeFetchHttpClient.ts
Line 7 in d211c97
const fetch = require("node-fetch");
The text was updated successfully, but these errors were encountered: