1

I am trying to deploy the NextJS Headless SXA app into the Sitecore XM1+ Headless SXA Docker container.

For this, i have setup the instance for Sitecore XM1 with following details:

  • SITECORE_VERSION=10.3-ltsc2019
  • TOOLS_VERSION=10.2-1809
  • SPE_VERSION=6.4-1809
  • SXA_VERSION=10.3-1809
  • EXTERNAL_IMAGE_TAG_SUFFIX=ltsc2019
  • HEADLESS_VERSION=21.0.583-1809

The NextJS Headless SXA app created using the JSS CLI 21.1.0.

Note: Headless image version 21.0.583-1809 and JSS 21.1.0 are compatible. There is no 21.1 Headless services version.

I have created the NextJS Headless SXA app using the npx create-sitecore-jss --templates nextjs,nextjs-sxa and followed the steps mentioned at Walkthrough: Connecting a code-first JSS Next.js application to Sitecore to deploy NextJS app (data folder missing in the Headless SXA NextJS App) into XM1 CM instance.

I have used the jss setup command also and not executed the jss deploy config because in Headless SXA website, website node managed by the SXA, so i have not deployed the Sites > site node and javaScriptServices>apps>app node config present at the FE NextJS app > sitecore*.config into Sitecore CMS.

I have also created the Headless Tenant and Headless Site in the Sitecore XM1 CM:

enter image description here

After that i am trying to use jss deploy items -c -d but its not working and getting Unexpected response from import service: Status message: Forbidden. Status: 403 error.

I have also validated the Sitecore Layout Service response https://cm.dockerexamples.localhost/sitecore/api/layout/render/jss?item=/&sc_apikey={xxx} and its returning the SXA website home item (/sitecore/content/DockerExamples/sxawebsite/Home).

I have also checked the article 403 forbidden errors when deploying JSS apps to Sitecore and created the HTTP based CMS instance but still jss deploy items -c -d command is not working.

Am i missing any steps to deploy code (NextJS App) into CM role as an Integrated mode?

GitHub Repo for SITECORE 10.3 HEADLESS SXA

1 Answer 1

0

As I see from the command you used npx create-sitecore-jss --templates nextjs,nextjs-sxa, you created a NextJS app using the nextjs-sxa template.

If you use this template, you don't need to perform the jss deploy items command because there are no items to deploy in the nextjs-sxa app template. Also, another reason for this error is nextjs-sxa does not have anything registered for the manifest, as nextjs-styleguide does.

You just need to create an app, connect it to Sitecore using jss setup command and create an appropriate JSS SXA headless site in the Content Editor: https://doc.sitecore.com/xp/en/developers/sxa/103/sitecore-experience-accelerator/create-a-headless-tenant-and-site.html

After creating and configuring the site, you just need to start the NextJS app (e.g. jss start:connected) and after the start of the app you can edit the site in the Experience Editor.

5
  • I have executed the jss setup command also but site is not coming up with start:connected. I am using localhost:3000 to access the website. Have you tried page editing using Experience Editor for Sitecore Headless SXA app?
    – Amit Kumar
    Commented Apr 6, 2023 at 8:49
  • what error you are getting after running start:connected. Yep, I have tried exp editor while working on headless SXA app on localhost. Make sure, JSS editing secret is matching in the Sitecore.JavaScriptServices.ViewEngine.Http.config Commented Apr 6, 2023 at 9:23
  • I have deployed the above file and executed the command jss start:connected and now blank Home page from website loading while accessing the url localhost:3000 If i am trying to open the Home node in Experience Editor in Sitecore CMS then getting error "Unable to connect to the remote server" Which url are you using to edit the page in Experience Editor?
    – Amit Kumar
    Commented Apr 6, 2023 at 14:04
  • This means, your local rendering host is not configured correctly, check this documentation: doc.sitecore.com/xp/en/developers/hd/210/… Commented Apr 7, 2023 at 6:58
  • I am not running rendering container, and trying to use integrated mode with CMS only. Will try above link. Thanks for your time.
    – Amit Kumar
    Commented Apr 8, 2023 at 6:24

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.