Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,5 @@ import path from 'path';

export default defineConfig({
plugins: [react()],
base: '/',
resolve: {
alias: {
'superdoc/dist/style.css': path.resolve(__dirname, '../node_modules/superdoc/dist/style.css')
},
dedupe: ['react', 'react-dom', 'react/jsx-runtime']
}
base: '/'
Comment on lines 5 to +7

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore React dedupe in demo Vite config

Removing resolve.dedupe from the demo config means the demo now loads two React instances: the app uses demo/node_modules/react while the locally linked @superdoc-dev/template-builder (demo/package.json link:../.) resolves react from the repo root’s devDependencies. When the demo runs (pnpm dev or pnpm build inside demo), React will detect the double copy and throw the “Invalid hook call” error as soon as hooks render. Keeping resolve.dedupe for react, react-dom, and react/jsx-runtime avoids the duplicate runtime that the previous version prevented.

Useful? React with 👍 / 👎.

});
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineConfig({
fileName: (format) => (format === 'es' ? 'index.mjs' : 'index.js'),
},
rollupOptions: {
external: ['react', 'react-dom', 'react/jsx-runtime', 'superdoc'],
external: ['react', 'react-dom', 'react/jsx-runtime', 'react/jsx-dev-runtime', 'superdoc'],
},
},
plugins: [
Expand Down
Loading