Skip to content

Form Devtools runtime error in nextjs: Client-only API called on the server side. #1741

@pedro757

Description

@pedro757

Describe the bug

runtime error in nextjs

Your minimal, reproducible example

I'll add this later

Steps to reproduce

Added the packages pnpm add @tanstack/react-devtools @tanstack/react-form-devtools @tanstack/react-query-devtools

// layout.tsx
export default function RootLayout(props: {
  children: React.ReactNode;
}) {
  return (
    <html
      lang="es"
      suppressHydrationWarning
    >
      <body>
        {props.children}
        <Devtools />
      </body>
    </html>
  );
}
// client.tsx
"use client";

import { TanStackDevtools } from "@tanstack/react-devtools";
import { FormDevtoolsPlugin } from "@tanstack/react-form-devtools";
import { ReactQueryDevtoolsPanel } from "@tanstack/react-query-devtools";

export function Devtools() {
  return (
    <TanStackDevtools
      plugins={[
        {
          name: "TanStack Query",
          render: <ReactQueryDevtoolsPanel />,
        },
        FormDevtoolsPlugin(),
      ]}
    />
  );
}

Expected behavior

I expected to see no runtime errors

How often does this bug happen?

Every time

Screenshots or Videos

Image

Platform

  • Linux
  • Brave 1.82

TanStack Form adapter

None

TanStack Form version

v1.21.1

TypeScript version

v5.9.2

Additional context

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions