Open
Description
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:
- Created the client component:
"use client";
import { scan } from "react-scan";
import { useEffect } from "react";
export function ReactScan() {
useEffect(() => {
scan({ enabled: true });
}, []);
return null;
}
- 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
Labels
No labels