You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have started a new project with Sitecore XM1, SXA and nextjs@22. Because of the network restriction I need to turn off the SSG during build process. After Setting DISABLE_SSG_FETCH=true the build is failing in three places:
in 'src\pages[[...path]].tsx': the issue is with sitemapFetcher, even if I remove the whole code from getStaticPaths it still does not work. i need to remove import { sitemapFetcher } from 'lib/sitemap-fetcher';
Second and third issues are in error pages 404 and 500.
To Reproduce
Run: npx create-sitecore-jss@^22.0.0 nextjs with the following options:
How would you like to fetch Layout and Dictionary data: GraphQL
How would you like to prerender your application: SSG
Are you building for Sitecore XM Cloud: No
Would you like to include any add-on initializers: nextjs-sxa , nextjs-multisite
After it is finished, set the DISABLE_SSG_FETCH=true in the .env file and run npm run build
Expected Behavior
Setting the DISABLE_SSG_FETCH=true should prevent requests to the edge endpoint and the build should not fail.
Possible Fix
I dont know how the first issue with sitemapFetcher can be fixed but for 404,500 pages there is an easy fix: the whole code inside the getStaticProps should be inside if (!process.env.DISABLE_SSG_FETCH).
Provide environment information
Sitecore Version:10.4
JSS Version:22.0
Browser Name and version: -
Operating System and version (desktop or mobile): Windows 11
Link to your project (if available): -
The text was updated successfully, but these errors were encountered:
I found a workaround for the issue, to prevent the build issue when you want to disable the SSG, in your .env file: DISABLE_SSG_FETCH=true GRAPH_QL_ENDPOINT=http://nonexisting/
Just filling out GRAPH_QL_ENDPOINT with something will solve the issue.
Describe the Bug
I have started a new project with Sitecore XM1, SXA and nextjs@22. Because of the network restriction I need to turn off the SSG during build process. After Setting
DISABLE_SSG_FETCH=true
the build is failing in three places:sitemapFetcher
, even if I remove the whole code fromgetStaticPaths
it still does not work. i need to removeimport { sitemapFetcher } from 'lib/sitemap-fetcher';
To Reproduce
Run:
npx create-sitecore-jss@^22.0.0 nextjs
with the following options:After it is finished, set the
DISABLE_SSG_FETCH=true
in the.env
file and runnpm run build
Expected Behavior
Setting the
DISABLE_SSG_FETCH=true
should prevent requests to the edge endpoint and the build should not fail.Possible Fix
I dont know how the first issue with sitemapFetcher can be fixed but for 404,500 pages there is an easy fix: the whole code inside the getStaticProps should be inside
if (!process.env.DISABLE_SSG_FETCH)
.Provide environment information
The text was updated successfully, but these errors were encountered: