Search code examples
next.jsdeno

Unable to setup a NextJS project using Deno 2


I'm trying to setup a NextJS project based on Deno2 using the following Deno 2 docs.

Deno2 NextJS

However, I get Hydration Failed error once I run the code. Steps to reproduce -

deno run -A npm:create-next-app@latest
deno install
deno task dev

I followed the advice from Github Discussions to rm -rf node_modules and .next but to no avail.


Solution

  • In my case, I've encounted "next: command not found".

    To resolve this error, I run:

    deno install npm:next