1

I am a newbie here. I was editing the .env file for adding the graphQLEndpoints. But in between something broke and I got this error.

This is the error I am getting in Front End side

This is the experience editor of Sitecore

This is the scjssconfig.json file

{
  "sitecore": {
    "instancePath": "C:\\inetpub\\wwwroot\\rengokusc.dev.local",
    "apiKey": "ED741CD3-65AB-495F-9510-************",
    "deploySecret": "c2431oi1tk5a4k2cg5usr7jfxgtpqew396********",
    "deployUrl": "https://rengokusc.dev.local/sitecore/api/jss/import",
    "layoutServiceHost": "https://rengokusc.dev.local/"
  }
}

I am using NextJS, Sitecore 10.3 (SXA with headless).

2 Answers 2

1

Guys, I got the solution!! I am writing it down below:

After adding this GRAPH_QL_ENDPOINT=/sitecore/api/graph/edge to the .env file, the error occurred.

Cause: I provided only path as the endpoint, you need to give the whole endpoint with site URL and path included. And if you check in src/temp/config.js you can see all the configurations for the project.

This was just some silly mistake, but learnt something new 🙂.

1

I also faced same issue during XM Cloud local setup

In my case to resolve this issue added some configuration in .env file, So first check bellow configuration in .env file

# To secure the Sitecore editor endpoint exposed by your Next.js app recommend an alphanumeric value of at least 16 characters.
1.JSS_EDITING_SECRET= Your JSS_EDITING_SECRET
# Your Sitecore API key is needed to build the app.
2.SITECORE_API_KEY=Your SITECORE_API_KEY
# Your Sitecore API hostname is needed to build the app.
3.SITECORE_API_HOST= Your SITECORE_API_HOST like // https://xmcloudcm.localhost
# Your GraphQL Edge endpoint. This is required for Sitecore Experience Edge.
4.GRAPH_QL_ENDPOINT=Your GRAPH_QL_ENDPOINT like // https://xmcloudcm.localhost/sitecore/api/graph/edge
# Your Sitecore site name.
5.SITECORE_SITE_NAME=YourSiteName
# Timeout (ms) for Sitecore CDP requests to respond within. Default is 400.
6.PERSONALIZE_MIDDLEWARE_CDP_TIMEOUT=400
# Timeout (ms) for Sitecore Experience Edge requests to respond within. Default is 400.
7.PERSONALIZE_MIDDLEWARE_EDGE_TIMEOUT=400

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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