This repository was archived by the owner on Sep 16, 2026. It is now read-only.
Commit d032f62
fix(web): wrap useSearchParams in Suspense boundary (#137)
Next.js 15.5 requires useSearchParams() to be wrapped in a Suspense
boundary when used in layouts or components that are statically
generated. This was causing build failures during pre-rendering of
the 404 page.
Solution:
- Extract PostHog page view tracking into PosthogPageViewTracker component
- Wrap PosthogPageViewTracker in <Suspense fallback={null}>
- Keep the rest of the Providers component outside Suspense
This allows Next.js to pre-render pages without the useSearchParams
hook, while still tracking page views on the client side.
Fixes build error:
useSearchParams() should be wrapped in a suspense boundary at page "/404"
Error occurred prerendering page "/_not-found"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent f5381be commit d032f62
1 file changed
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
| |||
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| |||
0 commit comments