Unknown 404 error


I tried countless times to fix my problem but nothing i tried worked.
This is the website i’m trying to fix:


I looked into other posts but nothing helped. If you could explain to me how to solve it, I would really appreciate it

@Radu1 You can use the Deploy File Browser to see what files you have deployed.

It should help you spot what is going on.

You will see a 404 for the main site url if there is no /index.html

I do have an index.html

I am not very experienced yet and i might mess up different things so please try to explain me as simple as you can. Thank you.

@Radu1 That’s not /index.html, that’s /crystal pool 111/public/index.html

You can see that file here:

You must set the Build configuration depending on what your project requires.

I can tell you don’t have your Build configuration set correctly because you seem to be just deploying your source files.

For example your package.json is here:

If your project is nested within a folder called crystal pool 111 in your repository, then you should set that as your Base directory in the Build configuration

I did some adjustments and deployed the project again.


I think the main issue is that i don’t really know how to set the right path for each component. I’m sorry you have to deal with me and i appreciate every advice :slight_smile:

7:55:03 PM: build-image version: fcb0c1b3ada6d25c1cb58e8bc514f5f23cc14f15 (focal)
7:55:03 PM: buildbot version: ee2ef905a4bdb64f7733dd60a718aa00319e6f82
7:55:04 PM: Building without cache
7:55:04 PM: Starting to prepare the repo for build
7:55:04 PM: No cached dependencies found. Cloning fresh repo
7:55:04 PM: git clone --filter=blob:none GitHub - RaduGiuroiu/Crystal-Pool-2.0
7:55:04 PM: Preparing Git Reference refs/heads/main
7:55:07 PM: Starting to install dependencies
7:55:09 PM: Python version set to 3.8
7:55:09 PM: Attempting Ruby version 2.7.2, read from environment
7:55:10 PM: Using Ruby version 2.7.2
7:55:11 PM: Started restoring cached go cache
7:55:11 PM: Finished restoring cached go cache
7:55:13 PM: go version go1.19.13 linux/amd64
7:55:14 PM: Using PHP version 8.0
7:55:16 PM: Downloading and installing node v18.20.2…
7:55:16 PM: Downloading https://nodejs.org/dist/v18.20.2/node-v18.20.2-linux-x64.tar.xz
7:55:16 PM: Computing checksum with sha256sum
7:55:16 PM: Checksums matched!
7:55:19 PM: Now using node v18.20.2 (npm v10.5.0)
7:55:19 PM: Enabling Node.js Corepack
7:55:19 PM: Started restoring cached build plugins
7:55:19 PM: Finished restoring cached build plugins
7:55:19 PM: Successfully installed dependencies
7:55:19 PM: Starting build script
7:55:22 PM: Detected 0 framework(s)
7:55:22 PM: Section completed: initializing
7:55:24 PM: ​
7:55:24 PM: Netlify Build
7:55:24 PM: ────────────────────────────────────────────────────────────────
7:55:24 PM: ​
7:55:24 PM: ❯ Version
7:55:24 PM: @netlify/build 29.39.1
7:55:24 PM: ​
7:55:24 PM: ❯ Flags
7:55:24 PM: baseRelDir: true
7:55:24 PM: buildId: 661c0a5a2a203290eba4b03d
7:55:24 PM: deployId: 661c0a5a2a203290eba4b03f
7:55:24 PM: ​
7:55:24 PM: ❯ Current directory
7:55:24 PM: /opt/build/repo
7:55:24 PM: ​
7:55:24 PM: ❯ Config file
7:55:24 PM: No config file was defined: using default values.
7:55:24 PM: ​
7:55:24 PM: ❯ Context
7:55:24 PM: production
7:55:24 PM: ​
7:55:24 PM: Build command from Netlify app
7:55:24 PM: ────────────────────────────────────────────────────────────────
7:55:24 PM: ​
7:55:24 PM: $ npm run build
7:55:24 PM: npm ERR! code ENOENT
7:55:24 PM: npm ERR! syscall open
7:55:24 PM: npm ERR! path /opt/build/repo/package.json
7:55:24 PM: npm ERR! errno -2
7:55:24 PM: npm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open ‘/opt/build/repo/package.json’
7:55:24 PM: npm ERR! enoent This is related to npm not being able to find a file.
7:55:24 PM: npm ERR! enoent
7:55:24 PM: npm ERR! A complete log of this run can be found in: /opt/buildhome/.npm/_logs/2024-04-14T16_55_24_850Z-debug-0.log
7:55:24 PM: ​
7:55:24 PM: “build.command” failed
7:55:24 PM: ────────────────────────────────────────────────────────────────
7:55:24 PM: ​
7:55:24 PM: Error message
7:55:24 PM: Command failed with exit code 254: npm run build (Search results for '"non-zero exit code: 254"' - Netlify Support Forums)
7:55:24 PM: ​
7:55:24 PM: Error location
7:55:24 PM: In Build command from Netlify app:
7:55:24 PM: npm run build
7:55:24 PM: ​
7:55:24 PM: Resolved config
7:55:24 PM: build:
7:55:24 PM: command: npm run build
7:55:24 PM: commandOrigin: ui
7:55:24 PM: publish: /opt/build/repo
7:55:24 PM: publishOrigin: default
7:55:25 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:55:25 PM: Failing build: Failed to build site
7:55:25 PM: Finished processing build request in 21.755s
7:55:25 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)

Change your base directory to Crystal Pool 111

That solved the issue. Thank you very much. The only thing left is that it only shows have white page.
I sit related to cache or index.html?

You need to change the publish path to build.

In my case build is the public folder?

No, I said build. Did you try that?

It didn’t fix the problem. I guess i did something wrong.

No it isn’t.

Your Publish directory needs to be build

You can confirm this by running your Build command locally.

Before you run your Build command the directories are:


After your Build command runs it shows:

And you have:


It has created a build folder, and that is what you must deploy.

Change your Publish directory from public to build.

I changed it and the white page is still there.

What white page?

Did you move the site?
I see this for the URL you provided in your original post:

Sorry about that. I deployed the site again while waiting for a reply.

@Radu1 Great, well this “white page” is closer than you’ve been before.

The reason the page isn’t showing is because it is broken.

The error shown in the developer console is:


The reason for this error is because the file doesn’t exist, and you have a _redirects rule that returns the /index.html for routes that don’t exist. So it’s returning HTML where it expects JavaScript.

The way to fix it is to make sure the file exists.

The src in your code is:

Going to that URL https://crpool.netlify.app/static/js/main.95870a0f.js will show the same blank page, since as explained above the file doesn’t exist, and the /index.html is being returned.

Checking the JavaScript files that your build produces locally I see:

But those also don’t seem to exist on the site.

You can again use the Deploy File Browser to confirm that the files don’t exist.

It works. Thank you so much and sorry for forcing you to deal with me :joy: