@layla93k My previous guess was correct.
The issue is your asset paths.
If you were to go directly to this URL:
https://thedidsburywardrobe.netlify.app/api/items/8
The assets look like they exist:
But the actual contents are those of your /index.html
file:
This is because the files don’t exist at those locations, and the rewrite rule is working.
The rewrite rule says “for any path that doesn’t have a file, return the contents of /index.html”.
You can see the page is trying to load:
https://thedidsburywardrobe.netlify.app/api/items/static/js/main.c42dee9b.js
But we know that particular file is actually here:
https://thedidsburywardrobe.netlify.app/static/js/main.c42dee9b.js
It’s loading the incorrect location because the asset paths have been specified with Relative URLs.
You’ll notice they all begin with ./
or ../
etc.
You should specify them as Root Relative URLs, so they should begin with /
I’m not sure what you’re working with, as you’ve not said, but if you’re using Vite you may have made precisely the same mistake as this other user:
Who had accidentally set the base
in their vite.config.js
to ./
Oh, and regarding your index.js
file, that one simply doesn’t seem to exist at all.
To confirm that you should run your build command locally, and then check the files it outputs.