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:
parent
fb8b73e290
commit
fb8f15aeec
@ -11,6 +11,9 @@ export default defineConfig({
|
|||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
root: '.',
|
root: '.',
|
||||||
publicDir: 'public',
|
publicDir: 'public',
|
||||||
|
optimizeDeps: {
|
||||||
|
include: ['react-ace', 'ace-builds'],
|
||||||
|
},
|
||||||
server: {
|
server: {
|
||||||
port: 5174,
|
port: 5174,
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user