pradel / create-react-app-esbuild

Use esbuild in your create-react-app for faster compilation, development and tests
MIT License
561 stars 34 forks source link

TypeError: Cannot read properties of undefined (reading 'findIndex') #69

Open com-macquarie-xwu7 opened 9 months ago

com-macquarie-xwu7 commented 9 months ago

Got the the following error when running craco start:

/xxx/node_modules/craco-esbuild/src/index.js:13
  const idx = webpackConfig.optimization.minimizer.findIndex(
                                                   ^

TypeError: Cannot read properties of undefined (reading 'findIndex')
    at replaceMinimizer (/xxx/node_modules/craco-esbuild/src/index.js:13:52)
    at Object.overrideWebpackConfig (/xxx/node_modules/craco-esbuild/src/index.js:58:5)
    at overrideWebpack (/xxx/node_modules/@craco/craco/dist/lib/features/plugins.js:36:38)
    at /xxx/node_modules/@craco/craco/dist/lib/features/plugins.js:53:29
    at Array.forEach (<anonymous>)
    at applyWebpackConfigPlugins (/xxx/node_modules/@craco/craco/dist/lib/features/plugins.js:52:29)
    at mergeWebpackConfig (/xxx/node_modules/@craco/craco/dist/lib/features/webpack/merge-webpack-config.js:119:70)
    at overrideWebpackDev (/xxx/node_modules/@craco/craco/dist/lib/features/webpack/override.js:8:80)
    at /xxx/node_modules/@craco/craco/dist/scripts/start.js:23:39

Node.js v18.18.2
❌ Failed to start dev server (exit status 1)