Skip to content

Commit 2de4b5d

Browse files
committed
fix(web): add @tanstack/react-virtual to Vite optimizeDeps
Add @tanstack/react-virtual to optimizeDeps.include and resolve.dedupe to ensure it uses the same React instance as the main app. This fixes "Cannot read properties of null (reading 'useReducer')" error that crashed the entire catalogue page. The error occurred because react-virtual was getting a different React instance during Vite's dependency pre-bundling.
1 parent 2349c94 commit 2de4b5d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/web/vite.config.ts

Lines changed: 2 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'],
171+
dedupe: ['react', 'react-dom', '@tanstack/react-virtual'],
172172
},
173173

174174
// Development server configuration
@@ -223,6 +223,7 @@ function createWebConfig(): UserConfig {
223223
'react-dom/client',
224224
'@tanstack/react-router',
225225
'@tanstack/react-query',
226+
'@tanstack/react-virtual',
226227
'@mantine/core',
227228
'@mantine/hooks',
228229
],

0 commit comments

Comments
 (0)