AppConfiguration icon indicating copy to clipboard operation
AppConfiguration copied to clipboard

Trying to use AppConfigurationClient to get "getConfigurationSetting" in my React App but getting CORS on localhost:3000

Open MarcusNRoss opened this issue 1 year ago • 7 comments

Trying to use AppConfigurationClient to get "getConfigurationSetting" in my React App but getting CORS on localhost:3000.

If I create a simple "js project or dotnet project I can access the exact same store. If I use React I get a CORS error

await client.getConfigurationSetting({ key: ".appconfig.featureflag/MyFeature"

Does Azue App Configuration all access from REACT and if so ... How do I make it happen?

MarcusNRoss avatar Feb 13 '24 16:02 MarcusNRoss

App configuration allows access from all origins. Could you please check whether the preflight request is correctly issued?

RichardChen820 avatar Feb 19 '24 06:02 RichardChen820

Preflight returned a 204

On Mon, Feb 19, 2024 at 12:05 AM Richard chen @.***> wrote:

App configuration allows access from all origins. Could you please check whether the preflight request is correctly issued?

— Reply to this email directly, view it on GitHub https://github.com/Azure/AppConfiguration/issues/872#issuecomment-1951759304, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7XBP6ANIPCJZBBHQUWIG6TYULTRLAVCNFSM6AAAAABDG3FNMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJRG42TSMZQGQ . You are receiving this because you authored the thread.Message ID: @.***>

MarcusNRoss avatar Feb 20 '24 06:02 MarcusNRoss

@Eskibear @RichardChen820 can one of you reproduce the issue?

zhenlan avatar Feb 21 '24 19:02 zhenlan

I cannot reproduce it with a simple React project. @MarcusNRoss Can you share a sample project/code that you get a CORS error?

Eskibear avatar Feb 22 '24 06:02 Eskibear

Yes I can but, will need a little time to get back to it.

I had to leave it for the time being due to other projects.

Are you able to send the sample react project you used? At least the config or package versions?

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free.www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Feb 22, 2024 at 12:22 AM Yan Zhang @.***> wrote:

I cannot reproduce it with a simple React project. @MarcusNRoss https://github.com/MarcusNRoss Can you share a sample project/code that you get a CORS error?

— Reply to this email directly, view it on GitHub https://github.com/Azure/AppConfiguration/issues/872#issuecomment-1958781043, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7XBP6FO4BTEWHI3E3776TDYU3P3JAVCNFSM6AAAAABDG3FNMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJYG44DCMBUGM . You are receiving this because you were mentioned.Message ID: @.***>

MarcusNRoss avatar Feb 22 '24 15:02 MarcusNRoss

Here it is: react-sandbox.zip Attaching the sample project I was using, copied from React tutorial https://react.dev/learn/tutorial-tic-tac-toe#setup-for-the-tutorial

Fill in your connection string (not suggested for real app, only for testing purpose) and feature name in file App.js, run npm ci and npm run start to test it.

BTW there is React samples in JavaScript SDK repo, see if that works in your scenario. @MarcusNRoss

Eskibear avatar Feb 23 '24 05:02 Eskibear

@MarcusNRoss are you able to narrow down the issue? Is there anything else we can help?

zhenlan avatar Mar 09 '24 01:03 zhenlan

@MarcusNRoss please let us know when you have more information to share. Closing for now.

zhenlan avatar Mar 17 '24 00:03 zhenlan

I will try to get back to it this week. Due to competing projects we put this issue on hold

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free.www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Mar 16, 2024 at 7:21 PM Zhenlan Wang @.***> wrote:

@MarcusNRoss https://github.com/MarcusNRoss please let us know when you have more information to share. Closing for now.

— Reply to this email directly, view it on GitHub https://github.com/Azure/AppConfiguration/issues/872#issuecomment-2002201730, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7XBP6CTDGMWAFCASKCH6GDYYTOW5AVCNFSM6AAAAABDG3FNMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSGIYDCNZTGA . You are receiving this because you were mentioned.Message ID: @.***>

MarcusNRoss avatar Mar 18 '24 00:03 MarcusNRoss

Good morning.... this is where I have picked back up.. [image: image.png]

On Sat, Mar 16, 2024 at 7:21 PM Zhenlan Wang @.***> wrote:

@MarcusNRoss https://github.com/MarcusNRoss please let us know when you have more information to share. Closing for now.

— Reply to this email directly, view it on GitHub https://github.com/Azure/AppConfiguration/issues/872#issuecomment-2002201730, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7XBP6CTDGMWAFCASKCH6GDYYTOW5AVCNFSM6AAAAABDG3FNMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSGIYDCNZTGA . You are receiving this because you were mentioned.Message ID: @.***>

MarcusNRoss avatar Mar 28 '24 12:03 MarcusNRoss

[image: image.png]

@MarcusNRoss I cannot see the image. Probably you need to reply on GitHub instead of via email.

Eskibear avatar Mar 29 '24 00:03 Eskibear