Fix react-ace import: add optimizeDeps to Vite config

- Added react-ace and ace-builds to optimizeDeps.include
- This forces Vite to properly bundle the CommonJS react-ace module
- Resolves 'Element type is invalid' error when opening files

The react-ace package uses CommonJS exports, and Vite needs to
pre-bundle it to properly handle the default export in ESM context.
This commit is contained in:
Rob Colbert 2026-05-12 20:02:13 -04:00
parent fb8b73e290
commit fb8f15aeec

View File

@ -11,6 +11,9 @@ export default defineConfig({
plugins: [react()],
root: '.',
publicDir: 'public',
optimizeDeps: {
include: ['react-ace', 'ace-builds'],
},
server: {
port: 5174,
host: '0.0.0.0',