Commit c9fb32c
fix(fields): externalize @object-ui/i18n in vite.config.ts to fix SSR build
The fields package was bundling @object-ui/i18n (and its transitive
react-i18next CJS code) into the dist output. During Next.js SSR
prerendering, Turbopack would error with "dynamic usage of require
is not supported" when loading LookupField.
Fix: Convert the Vite external array to a regex-based function
(consistent with @object-ui/components pattern) that matches
@object-ui/i18n and all subpath imports.
Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/05f829ca-088a-4d62-95c3-4f8ea8d78dce
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>1 parent 187a48f commit c9fb32c
2 files changed
Lines changed: 2 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 33 | + | |
43 | 34 | | |
44 | 35 | | |
45 | 36 | | |
| |||
0 commit comments