Error: exit code 2

Hi all,
I’m new to netlify, i have deployed an app on replit.com and works fine.
I have connected replit.com with github ad after i have imported the repository on netlify.
When i try to deploy i have an error in building, this is the complete log:

3:43:20 PM: Netlify Build
3:43:20 PM: ────────────────────────────────────────────────────────────────
3:43:20 PM: ​
3:43:20 PM: ❯ Version
3:43:20 PM: @netlify/build 29.31.1
3:43:20 PM: ​
3:43:20 PM: ❯ Flags
3:43:20 PM: baseRelDir: true
3:43:20 PM: buildId: 659ab874b11170997648d34e
3:43:20 PM: deployId: 659ab874b11170997648d350
3:43:20 PM: ​
3:43:20 PM: ❯ Current directory
3:43:20 PM: /opt/build/repo
3:43:20 PM: ​
3:43:20 PM: ❯ Config file
3:43:20 PM: No config file was defined: using default values.
3:43:20 PM: ​
3:43:20 PM: ❯ Context
3:43:20 PM: production
3:43:20 PM: ​
3:43:20 PM: Build command from Netlify app
3:43:20 PM: ────────────────────────────────────────────────────────────────
3:43:20 PM: ​
3:43:20 PM: $ npm run build
3:43:20 PM: > react-typescript@1.0.0 build
3:43:20 PM: > tsc && vite build
3:43:22 PM: Failed during stage “building site”: Build script returned non-zero exit code: 2
3:43:22 PM: src/App.tsx(58,29): error TS7006: Parameter “firestore” implicitly has an “any” type.
3:43:22 PM: src/App.tsx(58,40): error TS7006: Parameter “bookId” implicitly has an “any” type.
3:43:22 PM: src/App.tsx(58,48): error TS7006: Parameter “updatedData” implicitly has an “any” type.
3:43:22 PM: src/App.tsx(63,27): error TS7006: Parameter “book” implicitly has an “any” type.
3:43:22 PM: src/App.tsx(131,15): error TS2345: Argument of type “User” is not assignable to parameter of type “SetStateAction”.
3:43:22 PM: Type “User” provides no match for the signature “(prevState: null): null”.
3:43:22 PM: src/App.tsx(156,30): error TS7006: Parameter “e” implicitly has an “any” type.
3:43:22 PM: src/App.tsx(194,11): error TS7034: Variable “booksData” implicitly has type “any” in some locations where its type cannot be determined.
3:43:22 PM: src/App.tsx(200,14): error TS2345: Argument of type “any” is not assignable to parameter of type “SetStateAction<never>”.
3:43:22 PM: Type “any” is not assignable to type “never”.
3:43:22 PM: Type “any” is not assignable to type “never”.
3:43:22 PM: src/App.tsx(200,14): error TS7005: Variable “booksData” implicitly has an “any” type.
3:43:22 PM: src/App.tsx(203,29): error TS7006: Parameter “book” implicitly has an “any” type.
3:43:22 PM: src/App.tsx(213,31): error TS2531: Object is possibly “null”.
3:43:22 PM: src/App.tsx(243,35): error TS2339: Property “displayName” does not exist on type “never”.
3:43:22 PM: src/App.tsx(382,31): error TS2339: Property “id” does not exist on type “never”.
3:43:22 PM: src/App.tsx(383,29): error TS2339: Property “titolo” does not exist on type “never”.
3:43:22 PM: src/App.tsx(384,29): error TS2339: Property “autore” does not exist on type “never”.
3:43:22 PM: src/App.tsx(385,29): error TS2339: Property “genere” does not exist on type “never”.
3:43:22 PM: src/App.tsx(387,58): error TS2339: Property “id” does not exist on type “never”.
3:43:22 PM: src/App.tsx(400,28): error TS2339: Property “quantita” does not exist on type “never”.
3:43:22 PM: src/App.tsx(404,58): error TS2339: Property “id” does not exist on type “never”.
3:43:22 PM: src/App.tsx(417,28): error TS2339: Property “armadio” does not exist on type “never”.
3:43:22 PM: src/App.tsx(421,58): error TS2339: Property “id” does not exist on type “never”.
3:43:22 PM: src/App.tsx(434,28): error TS2339: Property “scaffale” does not exist on type “never”.
3:43:22 PM: src/App.tsx(438,58): error TS2339: Property “id” does not exist on type “never”.
3:43:22 PM: src/App.tsx(451,28): error TS2339: Property “possessore” does not exist on type “never”.
3:43:22 PM: src/App.tsx(455,58): error TS2339: Property “id” does not exist on type “never”.
3:43:22 PM: src/App.tsx(468,28): error TS2339: Property “nominativoS” does not exist on type “never”.
3:43:22 PM: src/App.tsx(472,58): error TS2339: Property “id” does not exist on type “never”.
3:43:22 PM: src/App.tsx(485,28): error TS2339: Property “classeS” does not exist on type “never”.
3:43:22 PM: src/App.tsx(489,58): error TS2339: Property “id” does not exist on type “never”.
3:43:22 PM: src/App.tsx(502,28): error TS2339: Property “dataP” does not exist on type “never”.
3:43:22 PM: src/App.tsx(506,58): error TS2339: Property “id” does not exist on type “never”.
3:43:22 PM: ​
3:43:22 PM: “build.command” failed
3:43:22 PM: ────────────────────────────────────────────────────────────────
3:43:22 PM: ​
3:43:22 PM: Error message
3:43:22 PM: Command failed with exit code 2: npm run build (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
3:43:22 PM: ​
3:43:22 PM: Error location
3:43:22 PM: In Build command from Netlify app:
3:43:22 PM: npm run build
3:43:22 PM: ​
3:43:22 PM: Resolved config
3:43:22 PM: build:
3:43:22 PM: command: npm run build
3:43:22 PM: commandOrigin: ui
3:43:22 PM: publish: /opt/build/repo/dist
3:43:22 PM: publishOrigin: ui
3:43:22 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:43:22 PM: Failing build: Failed to build site
3:43:23 PM: Finished processing build request in 21.35s

Someone can help me please?
Thanks in Advance
Simone

Hi @TokenRevolution,

Thanks for reaching out!

From the latest build here, I’m seeing these Typescript errors:

Resolving those errors should allow the build to succeed.