1

Issue: TypeError: Cannot destructure property 'datasource' of 'props.fields.data' as it is undefined.

  • Sitecore Experience Platform 10.2 (Sitecore Installation Framework (SIF) PowerShell module)
  • Sitecore Headless Services CD WDP for Sitecore XP
  • Sitecore Experience Edge Connector for Sitecore 10.2.0 XP 20.0.0
  • Sitecore Experience Accelerator 10.2.0 rev. 04247
  • Create a JSS project for the latest versions of JSS and Sitecore “npx create-sitecore-jss@ver20”

Local certificate has been created successfully and deployed the app by following this command.

jss deploy app --includeContent --includeDictionary --acceptCertificate xx:yyetc.

Backend successfully created the

/sitecore/templates/Foundation/JavaScript Services/App

I can run the app on localhost:3000 also can be accessed through newly created url

https://my-first-jss-app.dev.local/

Issue: I can see the home page and JSS Styleguide live examples, when I navigate to graphql it throws the below error:

Server Error
TypeError: Cannot destructure property 'datasource' of 'props.fields.data' as it is undefined.

69 | const { datasource, contextItem } = props.fields.data;

Following are my frontend env details:

JSS_EDITING_SECRET=Autocreated, SITECORE_API_KEY=filled, SITECORE_API_HOST=losthost created and assigned, GRAPH_QL_ENDPOINT(Empty), FETCH_WITH=REST

Backend details

JavaScriptServices.ViewEngine.Http.JssEditingSecret = frontend JSS_EDITING_SECRET

I have attached the below screen to explain more in details. Please someone shed a light on this issue. Thanks

enter image description here

enter image description here

enter image description here

1 Answer 1

0

Hi try looking into this Integrated GraphQL is not working correctly with JSS with SXA

looking at the details you've provided it seems like there is some problem with the api calls when it is executed in code

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Dec 12, 2022 at 4:27

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.