Support Forums

"Page Not Found" for Vanilla app even though "Base directory" and "Publish directory" seem to be fine

I have a very simple app that uses no frameworks or libs. It’s all about simple HTML, CSS and JavaScript files. It’s a monorepo with the following structure:

├── client/
│   ├── app.js
│   ├── index.html
├── server/
│   ├── app.js
│   └── node_modules

I want to serve the files under the /client dir.

I believe my Deploy Settings is properly configured. These are my configs:

  • Base directory: client
  • Build command: not set - empty
  • Publish directory: client/ (set automatically)

But then, whenever I deploy it and click on Preview, I get a “Page Not Found”.

I tried to download the deployed files to check if there was an index.html there. I expected to see only the content under /client inside the .zip but I see the whole project structure (ie. both dirs client/ and server/).

What am I doing wrong?

Netlify app:

@StanleySathler Please help us help you by writing a good post!

Build issues: Tell us about your workflow, including what SSG you are using.

If you are deploying via git, give us the URL of the repository.

The better the post = the faster we can help!

FWIW, it appears that while your site does load from the /client/ subdirectory, it is missing sw.js. From your description, your index.html file is already built, so why are you trying to build your project again? Why not just publish your client directory?

It appears you answered your own question in a duplicate post.

Thanks for the reply, @gregraven.

Yeah, there is a duplicated post 'cause yesterday, for some reason, I couldn’t find this topic under “My posts” even 10mins after publishing it. Maybe just another bug? :slightly_smiling_face:

Still, to be very honest, I don’t think you took the proper time to carefully read my post.

No GitHub repository, as it’s private. Sorry. No SSG, as mentioned above: it’s just a plain and classic HTML project.

Also, not sure if I got what you meant. All files are built, indeed, which is exactly why the “Build command” is empty. All I wanted to do is publish them, which is why I clicked on “Deploy site”, which led me to this issue.

Also, still curious about why a missing “sw.js” would cause this issue.

In any case, as pointed out by the duplicated post, I managed to fix this. You guys should definitely take a look at that and add your thoughts - I really believe this is a bug.

Hey there, folks!

@StanleySathler, Thank you for reaching out and sharing this issue. We appreciate it. As for the Forums, I cannot speak to why the thread was hard to find. That being said, I will keep my eyes peeled for any other members who share similar feedback!

In the interim, let’s continue this conversation in the open thread. I will close this one!

1 Like

@StanleySathler No, I read and re-read your post because it made no sense. If you have files that are ready to go – especially files that are not on GitHub – why do you have deploy settings at all? Why click on “Deploy site”? You don’t say, but if you are doing a drag-and-drop, then you need do this only with the “client” directory. Whatever you upload is what is going to be on Netlify. If you upload the wrong thing, then you won’t get the results you thought you were going to get. I note that you edited your original post to remove the name of the enclosing directory. If everything for your pre-built site is in your client directory, we don’t need to know about the other files in your project, and in fact they create a misdirection from the actual issue(s).