Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.05k stars 1.19k forks source link

[Electron] Using @azure/app-configuration in electron for feature flags throws error #19267

Closed CatalinMates closed 2 years ago

CatalinMates commented 2 years ago

Package Name: @azure/app-configuration Package Version: "latest" Operating system: MacOS BigSur version 11.6 nodejs v16.3.0: browser Google Chrome 96.0.4664.93 typescript "~4.4.0": electron "16.0.0"

Describe the bug I am trying to get the feature flags from app config using AppConfigurationClient and a connection string. When running the web application, everything seems to work as expected, but when building the web app and serving it within an electron context I receive the following error when trying to get listConfigurationSettings:

Error: ProxyPolicy is not supported in browser environment

To Reproduce

ramya-rao-a commented 2 years ago

@CatalinMates Apologies for the delay in response here, we missed this in our triage. @HarshaNalluru will take look at this by next week

HarshaNalluru commented 2 years ago

Hi @CatalinMates,

I've tried "listing" in a sample angular app, seems to work fine for me.

image

I've created a sample angular app with the code to do the listing and it seems to work fine. https://github.com/HarshaNalluru/angular-app-issue-19267

Please give that a try. Or Let me know how your setup is different. Or Provide us a simple sample repro. Or Let me know the steps to recreate your issue.

CataMates commented 2 years ago

Thanks for the reply and for the effort @HarshaNalluru! The problem that I've encountered, is not when using the angular app. (works fine also for me for angular app). The problem occurred when I've tried to use the build of the angular app within electron context. So, building the angular app, and serving the build using electron, to have a native (macOS/Windows) App

ramya-rao-a commented 2 years ago

@CatalinMates Can you provide a repo where you have this setup that we can use to replicate the issue?

HarshaNalluru commented 2 years ago

Thanks, @CatalinMates, haven't used that before. Will try it out and let you know if I can repro. As Ramya asked, it would be better/faster if you provide the example.

ghost commented 2 years ago

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

HarshaNalluru commented 2 years ago

@catalinmates @catamates As you haven't provided the exact steps to repro your issue, went ahead with a quick-start template for the angular app in the context of electron. To the quick-start template, added the previous listing-settings snippet and was able to list the settings properly without much of a hassle.

Look at the screenshot below. image

To try the sample app

# install dependencies
npm install

# And finally run the app (dev mode)
npm start

This is just a quick sample and the readme might have unnecessary information from the original repo.

If you have trouble following this, let me know if you want more info.

ghost commented 2 years ago

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost commented 2 years ago

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!