Skip to content

React Scan ran into a problem Cannot read properties of undefined (reading '__H') #373

Open
@salahbm

Description

@salahbm

Title: React Scan ran into a problem Cannot read properties of undefined (reading '__H')

Body:

I'm following the docs exactly using the <ReactScan> component method with Next.js App Router.

Steps:

  1. Created the client component:
"use client";
import { scan } from "react-scan";
import { useEffect } from "react";

export function ReactScan() {
  useEffect(() => {
    scan({ enabled: true });
  }, []);

  return null;
}
  1. Imported it at the top of app/layout.tsx:
import { ReactScan } from "./ReactScan"; // top-most import

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <ReactScan />
      <body>{children}</body>
    </html>
  );
}

But I still get this error at runtime:

Cannot read properties of undefined (reading '__H')


**Env:**

* Next.js 15.3.1 (App Router)
* React 18.3.1
* react-scan 0.3.3
* Node 18

Any idea what's wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions