0

The newly created JSS react app does not start. It shows completely blank page and shows error in the console while accessing the public URL i.e. http://jssreactweb/, Using fresh install of Sitecore 9.1.

Access to fetch at 'http://jss.sc/sitecore/api/jss/dictionary/JssReactWeb/en?sc_apikey={867CBF59-08E5-4B74-A106-A34485DB1D92}' from origin 'http://jssreactweb' has been blocked by CORS policy: 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.

Here is the console log.

JSS Issue

1

First thing you need to do is to check if the CORS Origins in your API key is not empty and should allow something, you can use * for allowing all.

enter image description here

Secondly, while accessing the public URL i.e. http://jssreactweb/ (may be different depending on your installation and configurations) You need to publish this API key. (It will be nice if you publish the whole website.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.