Errors in Netlify deployment, focusing on configuration parsing, finding the index.html entry module, and issues setting the base directory

Hi guys,

I am encountering the following error;

5:56:12 PM: Preparing Git Reference refs/heads/main

5:56:14 PM: Failed during stage “Reading and parsing configuration files”:
When resolving config:
Base directory does not exist: /opt/build/repo/Bank_modern_app/bank_modern_react_app

: exit status 1

5:56:14 PM: Failing build: Failed to parse configuration

I hoped to resolve the error by setting the netlify toml file to the path 'publish = “bank_modern_react_app/dist” '. Unfortunately the error did not go way.

I have since tried changing the deploy settings on Netlify to base directory empty string (as advised to on previous threads here) and the initializing (when deploying) has passed but now the building (when deploying) has failed with the error message

7:14:11 PM: Could not resolve entry module (index.html).
7:14:11 PM: error during build:
7:14:11 PM: Error: Could not resolve entry module (index.html).
7:14:11 PM: at error (/opt/build/repo/node_modules/rollup/dist/shared/rollup.js:198:30)
7:14:11 PM: at ModuleLoader.loadEntryModule (/opt/build/repo/node_modules/rollup/dist/shared/rollup.js:22483:20)
7:14:11 PM: at async Promise.all (index 0)
7:14:11 PM: ​
7:14:11 PM: “build.command” failed
7:14:11 PM: ────────────────────────────────────────────────────────────────
7:14:11 PM: ​
7:14:11 PM: Error message
7:14:11 PM: Command failed with exit code 1: vite build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
7:14:11 PM: ​
7:14:11 PM: Error location
7:14:11 PM: In Build command from Netlify app:
7:14:11 PM: vite build
7:14:11 PM: ​
7:14:11 PM: Resolved config
7:14:11 PM: build:
7:14:11 PM: command: vite build
7:14:11 PM: commandOrigin: ui
7:14:11 PM: publish: /opt/build/repo/dist
7:14:11 PM: publishOrigin: ui
7:14:12 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:14:12 PM: Failing build: Failed to build site
7:14:12 PM: Finished processing build request in 14.573s
7:14:12 PM: Failed during stage “building site”: Build script returned non-zero exit code: 2

This seems to be a loop of sorts; setting the base directory to an empty string results in the Initializing succeeding and the Build failing as a consequence of the index.html file which cant be located (of which it is present in the repository).

When I set the base directory on Netlify settings to Bank_modern_app/bank_modern_react_app and the .toml file to publish = “bank_modern_react_app/dist” the Build is successful but Initializing fails!

Thanks in advance for the help guys!

Looks like a problem with your repo and setup. It simply means there’s no index.html that could be found by Vite.