Internal Server Error after deploying headless sxa nextjs website for Sitecore XM Cloud

Hi

Components:

  1. Sitecore XM Cloud
  2. Sitecore SXA website
  3. Sitecore Experience Edge
  4. Headless JSS, Nextjs framework

Steps to reproduce:

  1. Created SXA website using Sitecore XM Cloud portal (default basic website)
  2. Created Experience Edge API
  3. Noted down environment variable: JSS_APP_NAME, SITECORE_API_KEY, GRAPH_QL_ENDPOINT (https://edge.sitecorecloud.io/api/graphql/v1)
  4. Created a new site in Netlify using GitHub project (GitHub project is created by Sitecore XM Cloud in my private repository)
  5. Setup environment variable mentioned above.
  6. Configured Publish folder to src/sxastarter/.next
  7. Configured Runtime environment to Nextjs
  8. Deployed successfully

Problem:
After browsing the website(have only 2 initial pages: home and home/about) I see Internal server error. Checking the logs I saw the Sitecore pages are redirected to “/.netlify/builders/___netlify-odb-handler” and I am not sure what is causing 500 issue.
I have tried same on Vercel and site is rendering without any issue.

Please let me know what I am missing here or if more information is required regarding error. I won’t be able to give repository details.

Thanks

If you share the site name we can probably guide better, but if I were to take a wild guess, it’s probably because of the ongoing issues with Next.js on Netlify and would be fixed in the upcoming Next.js Runtime.

Hi @hrishikesh

This is the site: https://eclectic-dolphin-44b812.netlify.app/
Any ETA around resolution?

Thanks

Just confirmed, you’re running into: https://github.com/netlify/next-runtime/issues/2329. This is already fixed in the new runtime which is currently in private beta. The sooner the important bugs are fixed, the sooner it would be released, though our estimate is by Q1 2024.

Thanks Hrishikesh for prompt response.