React-scripts 5 build fails on Netlify - "validate is not a function"
Author: topapippoCreated Mar 10, 2026Updated May 22, 2026
Labelsneeds triage
Titolo: React-scripts 5 build fails on Netlify - "validate is not a function" Messaggio: Hi, I need help deploying a React app on Netlify. Repository: https://github.com/topapippo/MBHS-GESTIONALE-EMERGENT Error: TypeError: validate is not a function at new TerserPlugin (terser-webpack-plugin/dist/index.js:180:5) at react-scripts/config/webpack.config.js:262:9 Node.js v18.20.8 Setup:
react-scripts: 5.0.1 Node: 18 Build command: npm install --legacy-peer-deps && npm run build Base directory: frontend
What I tried:
Node 16, 18, 20 overrides for ajv, schema-utils, ajv-keywords --legacy-peer-deps
Nothing works. How can I fix this?
Source: react/create-react-app