Skip to content

Nuqs not detecting adapter in Next.js 16 App Router setup #1263

@yWilliamLima

Description

@yWilliamLima

Context

nuqs version:

"nuqs": "2.8.5"

Framework used:

  • ✅ Next.js (app router)

Framework version:

"next": "16.0.8"

Description

When using NuqsAdapter inside the root layout of a Next.js App Router project, I get the following error:

⨯ Error: [nuqs] nuqs requires an adapter to work with your framework.

The adapter is set up exactly as shown in the documentation, but the error keeps appearing even though NuqsAdapter wraps the whole application.

Reproduction

Relevant code

import { NuqsAdapter } from 'nuqs/adapters/next/app'

export default function Layout({ children }) {
  return (
    <html lang="pt-BR" suppressHydrationWarning>
      <head />
      <body>
        <NuqsAdapter>
          <Providers>
            {children}
            <Toaster richColors />
          </Providers>
        </NuqsAdapter>
      </body>
    </html>
  )
}

Steps to reproduce

  1. Create a Next.js v16 project using the App Router.
  2. Install nuqs@2.8.5.
  3. Add NuqsAdapter to the root layout as shown above.
  4. Run npm run dev or next dev.
  5. The error appears immediately in the terminal or when loading the page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions