SAP Knowledge Base Article - Preview

3109990 - "No 'Access-Control-Allow-Origin' header is present on the requested resource" error when accessing JS Storefront in SAP Commerce Cloud

Symptom

When access JS Storefront, you may see message as below and then only the blank page displays.

If you open browser development tool > Network and reload page. You will see 500 error of the preflight request and no 'Access-Control-Allow-Origin' header is found.

In the Console, you will find below error and 504 error for the GET request.

Access to fetch at 'https://api.********-public.model-t.cc.commerce.ondemand.com/occ/v2/electronics-spa/cms/pages?fields=DEFAULT&pageType=ContentPage&pageLabelOrId=%2Fnot-found&lang=en&curr=USD' from origin 'https://jsapps.********-public.model-t.cc.commerce.ondemand.com' 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. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.


Read more...

Environment

SAP Commerce Cloud

Product

SAP Commerce Cloud all versions

Keywords

KBA , CEC-SCC-PLA-PL , Platform , CEC-SPA , SAP Commerce Cloud Spartacus , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.