Problem deploying fullstack - error 404 not found

I’ve been trying to deploy my simple phonebook application online.
Everything works fine local. I have built frontend and moved “dist” -folder to backend repository.
The problem is that only data passes to online website, but the website’s main page gives “Failed to load resource: the server responded with a status of 404 ()” - however …/api/persons and …/info works fine!
What seems to be problem? Please :slight_smile:

WEBSITE:
https://phonebook-backend-c4xw.onrender.com → /api/persons … /info … /api/persons/#ID

CODE ON GITHUB:

Hi,

The issue seems to be that your root path references a JS file that isn’t in your repo.

GET https://phonebook-backend-c4xw.onrender.com/assets/index-ff71a5a4.js net::ERR_ABORTED 404 (Not Found)

dist/assets - https://github.com/Konalawebsites/fullstackopen2023/tree/main/part3/dist/assets only a CSS in there.

Alan

Oh wow, thanks a lot! Didn’t check if it’s blocked in .gitignore.
Seems like .gitignore is not working properly and it leaks… node_modules also going to github even if it’s ignored

Konalawebsites

Adding things to .gitignore only applies to future changes, it’s likely that node_modules were already tracked by git and they weren’t removed before adding that directory to .gitignore. You need to remove (git rm) items from git before adding their directory, filename, etc. to .gitignore.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.