Customer accounts extension CORS error

I’m building a customer-account extension, I have to make a API call from here to my embedded app, but while making the api call i’m getting the CORS error says

Error:
“Access to XMLHttpRequest at ‘https://afflr-beta-vk.ngrok.io/api/customer-account/dashboard’ from origin ‘null’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.“

from the extension i’ve enabled the network_access and api_access and using the nest.js for app server there also enabled to allow all origins with,

app.enableCors();
app.use(helmet());

and also tried to mention explicit access but still getting the issue, what am i missing?

You’re hitting a very specific edge case with Shopify UI extensions. Because extensions run in a sandboxed Web Worker, they send an Origin: null header. Browsers are extremely strict with null origins.

Then how can i handle this?

Hi @VK_dev :waving_hand:
First location location location, know where you are and why you are posting there before posting.

Use the actual dev forums: https://community.shopify.dev

(same forum software, discourse, so you can manually copy the editing-content from there to there)

These are the PEER TO PEER forums for MERCHANTS and this subforums for app RECOMMENDATIONS.
Not private developer support.
http://www.catb.org/~esr/faqs/smart-questions.html#forum
https://stackoverflow.com/help/how-to-ask