Commit f1e0038
committed
fix(admin): avoid ~/modules/shared barrel in server-only router
The `~/modules/shared` barrel re-exports `useZodForm`, which imports
`useForm` from `react-hook-form`. Next.js picks the server build
(`react-server.esm.mjs`) for RSC / route handlers, and that build does
not expose `useForm` — so the indirect import chain
`adminStats.ts → shared barrel → useZodForm → react-hook-form` makes
`next build` fail on any server code that reaches the barrel.
Switch to a direct import from `~/modules/shared/nafSections` for the
two constants we actually need (DOMINANT_NAF_SECTIONS +
OTHER_NAF_SEGMENT) and document the trade-off inline so the next
server consumer doesn't re-hit the same trap.1 parent 438cfc9 commit f1e0038
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
0 commit comments