Base directory does not exist: /opt/build/repo/pokemon-app : exit status 1

  • we need to know your netlify site name

endearing-pika-3d972b

https://endearing-pika-3d972b.netlify.app

Deploy log

Initializing

Failed

12:35:32 PM: build-image version: 4b067841aaa59ef71931d3505b98c2bc3e63f36f (focal)
12:35:32 PM: buildbot version: a97756545adbd82de83b06c902122c919d70e7f2
12:35:32 PM: Fetching cached dependencies
12:35:32 PM: Starting to download cache of 81.1MB
12:35:33 PM: Finished downloading cache in 1.003s
12:35:33 PM: Starting to extract cache
12:35:33 PM: Finished extracting cache in 545ms
12:35:33 PM: Finished fetching cache in 1.592s
12:35:33 PM: Starting to prepare the repo for build
12:35:34 PM: Preparing Git Reference refs/heads/main
12:35:35 PM: Failing build: Failed to parse configuration
12:35:35 PM: Failed during stage ‘Reading and parsing configuration files’:
When resolving config:
Base directory does not exist: /opt/build/repo/pokemon-app

: exit status 1

I moved a lot in the settings because it was giving a construction error, then it started to give an error on startup. And the error in the build no longer appeared

how do i solve this?

N2

Are you able to share the repository @Eduardo77?

The repo: GitHub - 77Eduardo/Pokedex_project

Base directory is pokedex-app

5:48:27 PM: Netlify Build
5:48:27 PM: ────────────────────────────────────────────────────────────────
5:48:27 PM: ​
5:48:27 PM: ❯ Version
5:48:27 PM: @netlify/build 29.11.6
5:48:27 PM: ​
5:48:27 PM: ❯ Flags
5:48:27 PM: baseRelDir: true
5:48:27 PM: buildId: 64750f8eae27a551b36fe715
5:48:27 PM: deployId: 64750f8eae27a551b36fe717
5:48:27 PM: ​
5:48:27 PM: ❯ Current directory
5:48:27 PM: /opt/build/repo/pokedex-app
5:48:27 PM: ​
5:48:27 PM: ❯ Config file
5:48:27 PM: No config file was defined: using default values.
5:48:27 PM: ​
5:48:27 PM: ❯ Context
5:48:27 PM: production
5:48:27 PM: ​
5:48:27 PM: Build command from Netlify app
5:48:27 PM: ────────────────────────────────────────────────────────────────
5:48:27 PM: ​
5:48:27 PM: $ npm run build
5:48:27 PM: > pokedex-app@0.0.0 build
5:48:27 PM: > tsc && vite build
5:48:28 PM: src/components/notfound.tsx(1,1): error TS6133: ‘useRouteError’ is declared but its value is never read.
5:48:28 PM: src/components/notfound.tsx(3,1): error TS6133: ‘Footer’ is declared but its value is never read.
5:48:28 PM: ​
5:48:28 PM: “build.command” failed
5:48:28 PM: ────────────────────────────────────────────────────────────────
5:48:28 PM: ​
5:48:28 PM: Error message
5:48:28 PM: Command failed with exit code 2: npm run build (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
5:48:28 PM: ​
5:48:28 PM: Error location
5:48:28 PM: In Build command from Netlify app:
5:48:28 PM: npm run build
5:48:28 PM: ​
5:48:28 PM: Resolved config
5:48:28 PM: build:
5:48:28 PM: base: /opt/build/repo/pokedex-app
5:48:28 PM: command: npm run build
5:48:28 PM: commandOrigin: ui
5:48:28 PM: publish: /opt/build/repo/pokedex-app/dist
5:48:28 PM: publishOrigin: ui
5:48:29 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
5:48:29 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:48:29 PM: Failing build: Failed to build site
5:48:29 PM: Finished processing build request in 13.942s

after changing the Base directory it started giving build error

The reasons for the build error are clearly stated in the lines below.

The solution is to remove the unused declarations.