Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

dynamic routing on github pages with sveltekit

$
0
0

I am experimenting with dynamic routing on static site hosting services like github pages. I understand that normally you wouldn't want to do this and may have to jump through hoops to get it working.

I am using onMount function from svelte to load the data on the client side. I have two dynamic urls, /qna?id=1, this works but the other url /blog/[slug] fails. When I navigate to a url like /blog/hello, it returns the following error in console: Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://mohit2152sharma.github.io/_app/immutable/entry/start.a84ced15.js. My guess is this being caused by some path issue. If anyone has encountered similar issue, would appreciate your help and time.

(You can check out the repo here: https://github.com/mohit2152sharma/svelte-mpa-example)

PS: I have followed almost all the steps mentioned in the docs, like setting up csr=true and ssr=false, using adapter-static, using fallback='404.html' which is same as that of github pages error page.

PPS: If I deploy the same project on vercel it works, the only changes I make while deploying are change the adapter to adapter-vercel and use the defaults for adapter.


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>