Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MV-0001] "sitecoreEdgeContextId" is required. #189

Open
MatyasHavel opened this issue Dec 6, 2024 · 1 comment
Open

[MV-0001] "sitecoreEdgeContextId" is required. #189

MatyasHavel opened this issue Dec 6, 2024 · 1 comment

Comments

@MatyasHavel
Copy link

MatyasHavel commented Dec 6, 2024

I tried to make production release to Vercel with customized GraphQL Endpoint and I got this error: [MV-0001] "sitecoreEdgeContextId" is required. I got correct data from custom Edge, but then this Exception is raised.

I created custom GraphQL Endpoint with URL /sitecore/api/graph/edgePreview and this was deployed to Sitecore XM Cloud. This endpoint returns data of items in specific workflow states. I need to have non public site, which displays site without Draft workflow items. This works for local development, but not for production.

Environment variables looks like this:
SITECORE_API_KEY=XXX
GRAPH_QL_ENDPOINT=https://XXX.sitecorecloud.io/sitecore/api/graph/edgePreview
SITECORE_SITE_NAME=XXXX
DEFAULT_LANGUAGE=en
GRAPH_QL_SERVICE_RETRIES=3
FETCH_WITH=GraphQL

In previous versions it was not necessary to set SITECORE_EDGE_CONTEXT_ID for production. Is there any solution for this use case?

@MatyasHavel
Copy link
Author

I was able to identify reason, why it works in dev environment.

headapps\XXX\src\Bootstrap.tsx
.....
if (process.env.NODE_ENV === 'development') {
console.debug('Browser Events SDK is not initialized in development environment');
}
.....
else {
CloudSdk({...})
}

If I modify this condition, I am able to connect to different Edge and application works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant