Skip to content

Commit 51b5c28

Browse files
committed
fix(web): add force-graph packages to Vite optimizeDeps
Fixes graph page crash caused by React hook initialization error. The force-graph packages need to be pre-bundled and deduplicated to prevent multiple React instances during development.
1 parent 3a493eb commit 51b5c28

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/web/vite.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function createWebConfig(): UserConfig {
168168
alias: {
169169
'@': resolve(__dirname, 'src'),
170170
},
171-
dedupe: ['react', 'react-dom', '@tanstack/react-virtual'],
171+
dedupe: ['react', 'react-dom', '@tanstack/react-virtual', 'react-force-graph-2d', 'react-force-graph-3d', 'three'],
172172
},
173173

174174
// Development server configuration
@@ -226,6 +226,10 @@ function createWebConfig(): UserConfig {
226226
'@tanstack/react-virtual',
227227
'@mantine/core',
228228
'@mantine/hooks',
229+
'react-force-graph-2d',
230+
'react-force-graph-3d',
231+
'three',
232+
'three-spritetext',
229233
],
230234
exclude: [
231235
'@bibgraph/client',

0 commit comments

Comments
 (0)