Home
Support Forums

ERR Failed during stage 'building site': Build script returned non-zero exit code: 2

I need advice to debug deploy Netlify App

Welcome to the forums @gardeziburhan

There are unused variables declared in src/App.js that are never used. As stated warnings are treated as errors in a CI environment by default.

12:24:34 AM: Treating warnings as errors because process.env.CI = true.
12:24:34 AM: Most CI servers set it automatically.
12:24:34 AM: 
12:24:34 AM: Failed to compile.
12:24:34 AM: 
12:24:34 AM: src/App.js
12:24:34 AM:   Line 1:26:  'useEffect' is defined but never used  no-unused-vars
12:24:34 AM:   Line 5:27:  'Router' is defined but never used     no-unused-vars
12:24:34 AM:   Line 5:35:  'Route' is defined but never used      no-unused-vars
12:24:34 AM:   Line 5:42:  'Switch' is defined but never used     no-unused-vars

Remove the unused variables and if there are no other warnings/errors the build should succeed.