Can ICP support Next.js 12

Hello everyone,

I’m exploring the possibilities of using Next.js 12 on the Internet Computer Protocol (ICP) and wanted to ask the community if ICP supports Next.js 12 for decentralized applications. Specifically, I’m curious about:

Compatibility of Next.js 12 with the decentralized nature of ICP.
Any known challenges or limitations when deploying Next.js 12 apps on ICP.
Best practices for integrating Next.js features (e.g., middleware, SSR, ISR) with ICP.
If anyone has experience or insights, I would appreciate your guidance on setting up and deploying a Next.js 12 app within the ICP ecosystem.

Thank you!

3 Likes

I have an example NextJS 13 app deployed on ICP: GitHub - jennifertrin/nextjsicp: Example of how to deploy an existing NextJS application on the Internet Computer.

I have not explored specific NextJS features too much.

You can use Next.js out of the box with SSG by utilizing static exports.

If you do want to use SSR, then you’ll need some custom code or some libraries.

The challenges and limitations of SSR compared to SSG include the potential need for more update calls to certify the data, which leads to higher costs and slower responses when the data is not cached.

1 Like