DisableResponseDecompressionPolicy error with electron app using azure sdk from angular renderer
See original GitHub issueI have a desktop app that uses electron and angular. I am trying to upload the Blob storage using @azure/storage-blob
in the angular renderer process. When uploadData method is called library will just crash with following error:
Error: Uncaught (in promise): Error: DisableResponseDecompressionPolicy is not supported in browser environment
Error: DisableResponseDecompressionPolicy is not supported in browser environment
Please note I am using nodeIntegration: true when opening the angular portal like below:
this.mainWindow = new BrowserWindow({
webPreferences: {
nodeIntegration: true
},
});
From my understanding is that disableResponseDecompressionPolicy is only available in Node.js but this is a common use case where angular apps running inside an electron shell need to communicate with azure-storage. Can we get more clarity on this issue, whether this is a limit in the SDK and how can angular app inside electron work
old issue: https://github.com/Azure/azure-sdk-for-js/issues/14025
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:15 (11 by maintainers)
Top Results From Across the Web
Angular 11 Electron IPC communication 'send' of undefined
If you try to access them directly in your angular component, linter will give error because they are not defined on the standard...
Read more >How to access Electron Api in my Angular Components?
I do not have a renderer.js file as I'm using Angular. ... src/app/electron.api"; I get the error "Uncaught Exception: main.ts:1 import ...
Read more >How to create an Electron app using Angular and SQLite3.
This is a well documented issue. To get around this, we can use ThornstonHans' ngx-electron package, which wraps all the Electron API's exposed...
Read more >Securing an Electron App Implemented With Angular Using ...
Understanding the problem ... We are using the code flow to authenticate our application against the Secure Token Server (STS). In a web ......
Read more >Creating a Desktop App with Electron and Angular | Buddy
In this article, we'll learn how to build cross-platform desktop apps for Windows, Linux and macOS using Electron, TypeScript and Angular.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@gingi :
I think the issue is because: The bundler dectects it’s a browserfy environment and choses the browser version
DisableResponseCompressionPolicy
definition whenisNode()
is not invoked yet. While in runtime,isNode()
is invoked and returnstrue
due to configure ofnodeIntegration: true
Hi @jeremymeng ,
I may understand the issue wrong, please correct me if I’m wrong.
The issue here is: when customer set
nodeIntegration: true
,isNode
which detects the environment in runtime would return true, but the file is picked up in compiling and the compiler thinks it’s a browser.I see we only support
disableResponseDecompressionPolicy
in Node.JS, because we have no control on whether to decompress response content in Browser environment.If customer sets
nodeIntegration: true
, do we have control on on whether to decompress response content? If anyway, we cannot control it, I think maybe ignoring thedisableResponseDecompressionPolicy
setting with a warning is a good way to go.Thanks Emma