Questions tagged [nextjs]
Questions related to Next.js in Sitecore context should be considered into this tag.
161 questions
0
votes
0
answers
20
views
Marketo forms conflict across pages in Sitecore XM Cloud (Next.js SSR – old form not unloading)
We’re working on a Sitecore XM Cloud implementation with a Next.js frontend. Our site uses Marketo forms that appear on multiple pages.
Scenario
When a user navigates from one page with a Marketo form ...
1
vote
1
answer
77
views
Cannot read properties of undefined (reading 'route')
For context, I'm updating from Sitecore 10.3 XP using a multisite NextJS application using JSS version 21.7.1 to Sitecore 10.4 XP and JSS 22.9.0
I'm facing the following issue when loading the Site A ...
1
vote
3
answers
63
views
How do I prevent Experience Edge webhooks from timing out when publishing multiple items in Sitecore XM Cloud?
I'm using Sitecore XM Cloud with a Next.js application. I've set up an Experience Edge webhook to trigger ISR (Incremental Static Regeneration) when content is published.
The Problem:
When I publish ...
3
votes
3
answers
199
views
Commands to create Sitecore JSS NextJs project
I want to create a Sitecore JSS project using Next.js. I’m looking for the exact CLI commands to scaffold the project, including the recommended options (like GraphQL for data fetching and SSG for pre-...
0
votes
0
answers
29
views
How to mitigate head application content fetching issues when the content delivery endpoint is degraded or unavailable?
I recently encountered a scenario in which average response time spiked on my CD server. At times, response times were 20 seconds or longer.
This caused a massive increase in Vercel Function GB-hours ...
0
votes
1
answer
45
views
Vercel build failing due to "ClientError: Provided SSC API key is not valid"
My Vercel builds suddenly started failing in my test environment at the SSG/GetStaticProps step with the following error:
ClientError: Provided SSC API key is not valid.:{"response":{"...
0
votes
1
answer
86
views
Considerations for enabling/disabling CDP/Personalize in specific scenarios?
I am thinking about the key areas and scenarios one needs to consider regarding scenarios in which an app that integrates with the Engage SDK is being used in various scenarios such as an authoring ...
1
vote
2
answers
204
views
Type error: Namespace 'global.JSX' has no exported member 'Element'. XM Cloud Nextjs
Currently I am working on a sample app build on NextJs starter project where I have created a simple component, however my build is getting failed on XM Cloud Deploy App.
Next.js 15.3.5
Errors from ...
1
vote
2
answers
144
views
Caching throwing error on Next JS front end app
Hello Sitecore Community,
I would like to share a problem with Next JS app,
We are using Azure Linux Web App with Node JS 20 and Next JS version 14.2.25.
If anyone has faced similar issue or some ...
0
votes
1
answer
73
views
IE-0004: Unable to set the cookie because the browser ID could not be retrieved from the server
I am setting up Personalize on a headless site that I access via http://localhost:3000. I have the following code in middleware.ts:
const engageServer = initServer({
clientKey: "secret&...
0
votes
1
answer
63
views
Rendering website returns 500 error for some media assets
I am using Docker containers for local development. On my Next.js rendering site, some of the media assets on my local are responding with a 500 and the following error:
[ArgumentException: value]
...
2
votes
1
answer
86
views
Issues Running Next.js SSR App Alongside Sitecore CD on Same Azure App Service
I'm deploying a Sitecore JSS Headless Next.js project (with SSR support) along with a Sitecore CD instance on the same Azure App Service (Windows).
What I've done:
Deployed the Sitecore CD instance ...
3
votes
2
answers
103
views
Personalize component that targets a single page does not go away when user navigates to another page
We have a page that has the alert banner added from Personalize. If you navigate to another page using the primary navigation or any other internal links, the page changes but the banner doesn't go ...
2
votes
1
answer
104
views
Issue while Configuring a Sitecore Next.js Headless non-SXA Multisite App with XP 10.4 in Docker
Error while uploading package: 400 Bad Request
Could not find JSS app configuration for 'nhmmultisite'. Ensure you have included or previously installed a configuration patch file for the JSS app. ...
1
vote
1
answer
92
views
Issues Executing Scripts from CMS in CodeObject(which has html,css and script) Component (Next.js + Sitecore Headless)
We’re encountering an issue with a component(which is added in sitecore cms and has html,css,scripts) in our Sitecore Headless (Next.js) implementation.
In Sitecore XP, we were able to use Rich Text ...
0
votes
2
answers
111
views
How do I get an item's language versions in GraphQL for Sitecore JSS?
how can I get all of the languages that an item has versions in in GraphQL? e.g. in .Net I would have done this:
Item tempItem = Sitecore.Context.Database.GetItem(tempID);
foreach (var itemLanguage in ...
0
votes
1
answer
82
views
Extend multisite plugin in Sitecore headless
We are working on Sitecore nextjs project. By default, we have multisite plugin added in our solution which runs on jss build and puts all site details in config.js. This includes site name, host name ...
1
vote
3
answers
172
views
Get current item url in Sitecore headless
We want to render current sitecore item url in one of the sitecore nextjs component.
Just want to know if there is any API or any other correct way to do it?
1
vote
3
answers
138
views
Render script from multiline field in head tag in Sitecore Headless
We are trying to implement our sxa metadata partial design to headless site. We have one HTML Snippet component which renders value from one multiline field. We have some third party scripts there in ...
2
votes
2
answers
228
views
Created custom 404 and 500 error pages in XM Cloud local instance, but redirecting isn't working
I have successfully implemented custom 404 and 500 error pages in my XM Cloud local instance, following the guidelines outlined in this article. Below are the steps I followed.
Created custom 404 and ...
1
vote
2
answers
175
views
How sitemap xml is generated with sitecore jss with nextjs
Any reference for how to generate sitemap xml with sitecore jss with nextjs.
For me getting 404 error page for URL http://localhost:3000/sitemap.xml.
1
vote
0
answers
68
views
XM Cloud CM environment throws X-Forwarded-Port exception
We recently upgraded to JSS 22.1 and we encountered an issue when our Next.js app running on localhost:3000 is trying to call the edge API:
We didn't encounter this issue before the upgrade so we're ...
2
votes
0
answers
91
views
In Sitecore 10.4 Next.js Multisite Template Causing Layout Service 404 Error due to Unexpected '/pipe/{GUID}' Segment
We are using Sitecore 10.4 with the Next.js multisite template, hosted on an IIS server using IISNode. We have two websites, namely site-one and site-two, and the multisite resolver is correctly ...
2
votes
2
answers
268
views
NEXTJS Form submission throwing error 'System.InvalidOperationException: securityContext'
This is a vanilla installation on my local Sitecore 10.4 XP. The module installed is Sitecore Headless Services Server XP 22.0.11. The front-end is using the Get Starter template, version 22.3.1, with ...
0
votes
1
answer
96
views
Multilist field data not appearing in Sitecore rendering props
I'm trying to figure out a multilist field on a rendering in Sitecore 10.2 headless. I created a rendering in Sitecore. It has the Datasource Resolver. The datasource has a single field, 'locations', ...
0
votes
1
answer
134
views
Sitecore Experience Editor fails to open with error 'Connection to your rendering host failed with a Request Entity Too Large error.'
In our headless 10.2 site, pages that have a lot of content fail to load in Experience Editor, with the error Connection to your rendering host failed with a Request Entity Too Large error. Ensure the ...
1
vote
0
answers
100
views
GraphQL Method Not Allowed - Docker Headless Next.JS
I'm getting 405 method not allowed for the layout request in my local developer 10.4 Headless SXA site with Docker.
Backstory - I initially had everything up and running before being forced a Windows ...
4
votes
1
answer
139
views
What options are available to handle the dynamic routes in Sitecore and Next.js?
What options are available to handle the dynamic pages in Sitecore and Next.js? Let's say we have created a page called "devpage" and we have the dynamic routes like this devpage/{dynamic ...
3
votes
1
answer
251
views
How to Prevent API Call in Sitecore Search Until User Submits Search in Next.js (Sitecore JSS)?
I'm working with Sitecore-Search and Next.js (Sitecore JSS) to create a search component. Right now, I don’t want the search API to be called when the page loads. I only want the API call to happen ...
5
votes
4
answers
383
views
Issues setting up Multi Lingual Site created in XM cloud with next JS
I recently tried to add another language for my website created in XM cloud. I used the OOB script provided by Sitecore to add another language and have published the items in edge server as well.
...
5
votes
1
answer
285
views
Hide API Key in Front-End GraphQL Calls in Sitecore Next.js
We have a headless website with a front end based on a Next.js starter template. We use connected GraphQL calls for certain search and filter functionalities, allowing users to interact with the site (...
2
votes
1
answer
196
views
How to create rendering variant in sitecore jss with nextjs
How to create a rendering variant in sitecore jss with nextjs. Any document to follow.
2
votes
3
answers
203
views
SXA language emabedding
I'm working on an SXA multilingual site and have set the language embedding option to "always." I've also added the source and destination URLs.
Example below
I've accessed our business ...
6
votes
3
answers
673
views
Which NextJS version for Sitecore/JSS X?
I got the question to check which version of NextJS was compatible with Sitecore 10.2 - 10.4. I managed to find information in the Compatibility table but that refers to the versions of JSS / Headless ...
4
votes
1
answer
441
views
Third-Party scripts and iframes not Loading on Page Navigation with Sitecore JSS Link in Next.js
I'm using Next.js with Sitecore JSS in a headless project, and I have a problem with loading third-party scripts and iframes when navigating between pages.
What’s happening:
If I use Sitecore's <...
2
votes
5
answers
222
views
What will be impact areas if we don't set targethostname in Sitecore SXA cms in Sitedefinition?
In Sitecore .Net 10.3.1 (rev. 009452) SXA based Site with docker setup, we configured site definition for CM/CD/Preview, and updated hostname in SXA CMS.
Now in our environment targethostname is ...
3
votes
4
answers
586
views
Fetch grapghQl response in next js
How to fetch the response of a graph ql query from next js
2
votes
2
answers
651
views
Custom 404 Page in Multisite Environment of Sitecore JSS + Next.js
Is there a way to support customized (per site) 404 pages in a multisite environment of Sitecore JSS + Next.js? According to Sitecore, it’s not possible, but perhaps someone has figured out a ...
1
vote
1
answer
96
views
Headless - Can child items have its own style parameters?
I have a rendering with a data source item, and under it are child items; both of which are being retrieved via GraphQL. One of our requirements is for these child items to be styled differently and ...
2
votes
0
answers
125
views
How to fetch the users list from user manager in sitecore xm cloud and expose it through layout service
We have one functionality to fetch the list of users from user manager in Sitecore xm cloud and pass the data to layout service. It's a headless approach and we are only using next js and not using ....
3
votes
2
answers
157
views
Wildcard Pages in a multiste NextJS Head
Was anyone able to get wildcard pages working with a multisite Next.js head? All solutions I have seen just assume that your head is for a single site so there is no need for the multisite middleware.
...
1
vote
1
answer
388
views
DataSource item's fields object is not coming in the layout service in graphql
I have one footer component available on the page design and that page design is applied on all of the pages of the site. When I try to run the site locally using next js localhost:3000 application ...
0
votes
1
answer
202
views
Facing build error in SItecore10.1 JSS NextJS Project with adding output: 'export' in next.config.js
Steps I have followed so far:
npm i -g @sitecore-jss/[email protected]
jss create testapp nextjs --branch release/18.0.0
jss start
Add output:'export' in next.config.js file
npm run build - **...
1
vote
2
answers
293
views
Sitecore .tsx component not mapping props
I have a project with footer.tsx component in it. I am trying to load the next js project with npm run start:connected command and it is giving me the error as
It should map the properties on the ...
1
vote
1
answer
410
views
"Cannot query field \"layout\" on type \"Query\
I am trying to work with Graph QL Endpoint "/sitecore/api/graph/items/master" in my next js app. But I am receiving error as "Cannot query field "layout" on type "Query&...
0
votes
1
answer
171
views
First request after Vercel deploy results in GraphQL.ExecutionError: Error trying to resolve path
After a Vercel deploy, the first request to the site results in a client side exception in which a web page does not render properly until a subsequent load. The page is rendered via SSR.
On the back ...
2
votes
2
answers
366
views
Source query For General Link Field Type
We need to use a source query for the General Link field type to display only the current page's data. In Sitecore XM Clould, is there any way we can achieve it from the front code (NextJs) as the ...
1
vote
2
answers
312
views
ERR_HTTP2_PROTOCOL_ERROR while changing the Layout in Sitecore Headless SXA 10.3
We are working on Sitecore 10.3 SXA (Headless with Next.js).
While trying to change the layout of a site, we are getting (failed)net::ERR_HTTP2_PROTOCOL_ERROR while accessing the Layout Service.
Are ...
2
votes
1
answer
220
views
Error Boundary not working in Sitecore JSS with Next.js Project
I am using Sitecore 10.3.1 with JSS-Next.js app version 21.5.3 and Node version 21.7.3.
My requirement is to handle client and server errors at the component level. I am currently using the "?&...
2
votes
1
answer
136
views
"Component GraphQL Query" field is ignored in Experience Editor
I installed the Sitecore 10.4 with Headless SXA and I noticed a strange behavior. On the components which has a "Component GraphQL Query" this field is ignored. On a 10.3 solution Link List ...