I’m using the Svelte framework. When I attempt to deploy my site on netlify (or any hosting service for that matter), I am met with a “Page not found” and an error in the console which reads: "Failed to load resource: the server responded with a status of 404 (). "
@zeroproof It’s possible you have a couple of things set incorrectly…
Basic build settings
Make sure that your Basic build settings on Netlify are correct.
Specifically ensure that your Publish directory is dist. dist is the folder that your npm run build is outputting files to.
Netlify will display the default Page Not Found error when the folder you’ve deployed does not contain an index.html file.
Differences between local & Netlify - how to test
Most site builders don’t run precisely the same thing when using their “development” mode compared to their “build” mode, and this is how you can end up thinking “things run locally, but not on Netlify”.
To do a more accurate check, run your build command locally (npm run build), go into your output folder (dist) then serve those static files (npx serve) and see what happens. Provided that your Basic build settings are correct on Netlify, you should see the same thing both on your system and on Netlify.
Your assets (css/js) aren’t being loaded because the paths to them are incorrect:
Hi @nathanmartin ,
Thanks for the prompt and succinct response. Thanks for the little npx serve tip. I went in and changed the line in vite.config.js to /Dashboard/assets which fixed the error in the console.
@zeroproof I’m not sure what you mean by the path of /Dashboard/assets having fixed your issue, nor can I tell why you’ve chosen that specific value, since I don’t see any folders corresponding to that path in the repository.
Running the build and then serving the static files I still see what I would expect… precisely the same issue, but this time with /Dashboard/assets at the start of the paths, instead of /Phantasma-Dashboard/.
You may actually want your base to just be /, at least when I do that I see:
It most certainly should. https://pharpc1.phantasma.io:7077 instead loads with an SSL_ERROR_RX_RECORD_TOO_LONG error.
Looking through documentation and examples on phantasma-io/phantasma-ts they always use http:// not https://. Guess they don’t really take security that serious in the blockchain community (or at least this service provider doesn’t.)
I think there has been a pretty big overhaul of the blockchain code after a recent audit and a lot of the documentation is being updated/replaced. I’m gonna assume the APIs are being updated. I’ll know more Monday. Thanks again guys for all your help
This is how it should look once those get updated: