Commit 0ea140e
committed
fix(admin): bypass admin/stats + shared barrels in server router
Follow-up to 'avoid ~/modules/shared barrel in server-only router':
the first fix only changed the direct import, but adminStats.ts still
went through the `~/modules/admin/stats` barrel for schemas + types.
That barrel re-exports `ConformiteStatsPage` (client component), which
in turn imports from `~/modules/shared` → `useZodForm` /
`useDsfrModal` → the `react-server` build of `react-hook-form` that
does not export `useForm` / `useRef`. The Next.js dev overlay kept
surfacing the same error even though the build passed in CI (turbopack
vs webpack difference).
Switch every import in the router to internal file paths
(`~/modules/admin/stats/{schemas,types}` and `~/modules/shared/nafSections`)
and document the trade-off with a comment block. The proper long-term
fix is to split each barrel into client / server halves.1 parent bd4f59d commit 0ea140e
1 file changed
Lines changed: 14 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
13 | 26 | | |
14 | 27 | | |
15 | 28 | | |
16 | 29 | | |
17 | 30 | | |
18 | 31 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 32 | + | |
25 | 33 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
0 commit comments