Static site deployment with pre-rendered slug-based routing getting a 500 internal error #10925
-
Describe the bugI have a project to build a personal website with a blog component. The blog logic reads a markdown file, parses it into HTML, and displays it. The blog routing is slug-based, and I deployed to GitHub pages on ali-mir.com via I'm a complete beginner to SvelteKit and webapps in general, but from what I've read you can't prerender dynamic routes. The solution was to specify the (my apologies if this bug is related to some mistake I'm making, and not some issue in the SvelteKit core!) ReproductionIf you go to ali-mir.com and click on "blog" and then "hello world", you will see the 500 internal error. Logsapp.9c4190f0.js:1 SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
handleError @ app.9c4190f0.js:1
...
/blog/hello-world/__data.json?x-sveltekit-invalidated=01:1 Failed to load resource: the server responded with a status of 404 () System InfoSystem:
OS: macOS 13.6
CPU: (10) arm64 Apple M1 Pro
Memory: 2.21 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.0.0 - /opt/homebrew/bin/node
npm: 10.2.0 - /opt/homebrew/bin/npm
Browsers:
Chrome: 118.0.5993.88
Safari: 17.0
npmPackages:
@sveltejs/adapter-static: ^2.0.3 => 2.0.3
@sveltejs/kit: ^1.25.2 => 1.25.2
svelte: ^4.2.1 => 4.2.1
vite: ^4.4.11 => 4.4.11 Severityannoyance Additional InformationI asked a similar question on StacKOverflow (before I found the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
Hi Ali, have you tried redeploying your site? I've tried to reproduce this locally and wasn't able to. You will need to ensure the The reason the page fails to load is because In contrast, it works when you refresh the page because we are not requesting the |
Beta Was this translation helpful? Give feedback.
Hi @ali-mir , I've setup a basic github pages deployment and I'm able to access my files that start with an
_
.https://github.com/eltigerchino/eltigerchino.github.io
https://eltigerchino.github.io/_app/version.json
https://eltigerchino.github.io/blog/hello-world/__data.json
I see that you have added a
static/.nojekyll
file and renamed_app
toapp
. I suggest trying to revert those changes and see if that helps. I have a feeling that your current site is unable to serve files that start with_
.