23.x
  1. Next.js

Upgrade JSS 22.12 Next.js apps to version 23.0

This topic covers the changes you must make to your existing JSS 22.12 applications to upgrade to version 23.0. However, because of the nature of JavaScript and Next.js application development, this topic doesn't account for all the customization you might have in your existing application.

While upgrading, consider the JSS templates and add-ons you used when creating your Next.js application. You can find them in your package.json file. For example, a JSS 22.12 application included in the XM Cloud starter foundation uses the following templates and add-ons:

  • nextjs
  • nextjs-styleguide or nextjs-sxa
  • nextjs-multisite
XM Cloud is now SitecoreAI

Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.

Before you begin
  • If you haven't already done so, upgrade your app to JSS 22.12.

  • Familiarize yourself with the changelog. If your application is heavily customized, the changelog can provide guidance on what additional changes you need that are not covered in this topic.

Update application dependencies in your existing app

For your upgraded application to work correctly, you will need to update dependencies.

To update your dependencies:

  1. In your existing application's package.json update every @sitecore-jss package to version ~23.0.0.

  2. Install the dependencies with the following command:

    npm install

Update the Next.js template files in your existing app

This explains how to synchronize files in your existing application with corresponding files from your new JSS 23.0 app.

To update the Next.js template files:

  1. The Placeholder component automatically passed several internal props (api, componentFactory, modifyComponentProps, sitecoreContext, and updateSitecoreContext) to rendered components. These props are no longer forwarded. Components rendered through Placeholder now only receive the following props by default:

    • fields
    • params
    • rendering
    • Additional props returned by modifyComponentProps

    If your components depend on custom props being passed through a Placeholder, use the new passThroughComponentProps property to explicitly pass those values. Review custom components that access any of the removed internal props and update them to obtain that functionality through supported APIs or explicit prop passing.

  2. The VercelEditingDataCache implementation and the @vercel/kv dependency have been removed due to the deprecation of Vercel KV. Replace usage of VercelEditingDataCache with RedisEditingDataCache. See Use an out-of-process editing data cache with Vercel deploymentsd for more information.

Next steps

To finalize the upgrade process, make sure you resolve any errors and warnings you encounter. Enable debug logging for JSS specific issues to assist you if necessary.

If you have suggestions for improving this article, let us know!