I have seen others ask this question but no other answers seem to help.
I have a basic svelte / sapper application that has a Nav Bar component.
Locally, the navbar and website functions perfectly, however, when deploying to netlify ( and using npm run dev
and __sapper__/export
), I get a few issues...
First issue is that my ChartJS charts won't load. Maybe that is for another question, but might be relevant
When clicking on a nav link, the url changes to the proper URL within my browser, but the page does not load. However, after clicking a nav link and seeing the URl appear in the browser search bar, I can just reloading the page and the desired page will load( but again, without any chartJS charts ), but, it adds a "/" to the end of the route ( which it doesn't do locally ).
When trying to visit a route not in the navbar, I get a "Page not found" error, despite it appearing locally.
I have deployed a sapper site before, using the same commands, but for some reason, this site will not work.
The only relevant code would be my _layout.svelte
which holds my NavBar, so it appears across all screens. Similar to the default layout in something like Vue I believe.
import Nav from '../components/Nav.svelte';
<style>
</style>
<Nav/>
<main>
<slot></slot>
</main>
I can't seem to find any fixes, at least ones that have worked for me.
What is very confusing to me is why one of my routes gives the "page not found" error, despite the route existing. Why would ONLY that route not appear on netlify, and not other routes I directly route to from the Browser Search bar.
Thank you in advance for any advice.