azure-sdk-for-js
azure-sdk-for-js copied to clipboard
Error: proxyPolicy is not supported in browser environment - Electron App
-
Package Name:
@azure/[email protected]
that has a dependency on@azure-rest/core-client": "^1.1.0
and@azure/core-rest-pipeline": "^1.8.0
,
Describe the bug
Unable to make a rest API call on the renderer on the ElectronApp because I get the following error: Error: proxyPolicy is not supported in browser environment
. nodeIntegration
is set to true
and we can't turn this off.
the workaround for this is to run the API request on the main thread, but I would like to remove this workaround and have it all run in the renderer process.
To Reproduce Steps to reproduce the behavior:
- Install azure/[email protected] to an electron app that has
nodeIntegration
set to true - Make a rest api call to ai translation
- See error coming from
@azure/core-rest-pipeline
that is the dependency tree of@azure/rest-ai-translation
Expected behavior
Able to make a rest api request from the renderer process without getting Error: proxyPolicy is not supported in browser environment
error.
Screenshots
Additional context Unable to provider the source code as it is not open sourced.