0

Here are the steps I took condensed:

  • Published my project using VSCode's publish repo button.
  • added the npm command: npm run deploy => npx gh-pages -d dist
  • ran npm run build
  • ran npm run deploy
  • added "base:"/lilys-website/"," into the file vite.config.js
  • ran npm run build & npm run deploy again

The issue is that my page is only loading in the CSS but not the JS from what I can guess. It's only showing a blank screen. Looking at DevTools doesn't help as there isn't any errors for not being able to load a file.

Steps taken are from this video: https://www.youtube.com/watch?v=d-PTp1rmr30

Repo: https://github.com/DoormatIka/lilys-website

Lilyn
  • 35
  • 5
  • Does this answer your question? [SvelteKit deployment on gh - pages doesn't work. Only HTML is shown, CSS and JS doesn't load](https://stackoverflow.com/questions/75497065/sveltekit-deployment-on-gh-pages-doesnt-work-only-html-is-shown-css-and-js) – H.B. Mar 07 '23 at 19:24

1 Answers1

0

Fix your routes. This applies to SvelteKit and Svelte + Vite.

Bad:

<Router>
  <Route path="/" component={Main}/>
  <Route path="/about" component={About} />
</Router>

Good:

<Router>
  <Route path="/[REPO NAME]" component={Main}/>
  <Route path="/[REPO NAME]/about" component={About} />
</Router>
Lilyn
  • 35
  • 5