aidenybai / aidenybai/react-scan

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

未關閉
#373 6 則留言 6 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
21.8k
分支
390
平均合併
23 分鐘
30 天內合併 PR
1

描述

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

**Body**:

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

**Steps:**
1. Created the client component:

```tsx
"use client";
import { scan } from "react-scan";
import { useEffect } from "react";

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

return null;
}
````

2. Imported it at the top of `app/layout.tsx`:

```tsx
import { ReactScan } from "./ReactScan"; // top-most import

export default function RootLayout({ children }) {
return (


{children}

);
}
```

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?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。