Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server restart is required after every route creation #2

Open
edgarasben opened this issue Apr 11, 2021 · 2 comments
Open

Server restart is required after every route creation #2

edgarasben opened this issue Apr 11, 2021 · 2 comments

Comments

@edgarasben
Copy link

edgarasben commented Apr 11, 2021

I noticed that after I create every new route e.g. "/routes/about.svelte" I need to restart a server (otherwise I get 404). I know this is not the case with a standalone SvelteKit.

@aral
Copy link
Contributor

aral commented Apr 12, 2021

Hey @edgarasben,

Sadly, this is a fact of life for now but, hopefully, soon it will be possible to have the same experience you can have with Hugo (in that the generated content is updated every time you save). You still won’t have hot module reloading and I don’t see that changing anytime soon.

That said, if you want to test using hot module reloading, just open a different browser window at http://localhost:3000 and, there, you will see your SvelteKit client update in real time (but no Site.js-specific routes will be present as it’s just the SvelteKit client that’s being served there). You can have https://localhost and http://localhost:3000 open in two different browser tabs/windows to get the best of both worlds.

For hot reloading to work at https://localhost (i.e., the site that’s being served by Site.js), I’m waiting on this pull request making it into SvelteKit:

vitejs/vite#1449

@edgarasben
Copy link
Author

@aral thank you for taking time for an explanation. Sorry for the lack of expertise, but for sure it would be nice in the future if HMR would work fully on the localhost (Site.js + SvelteKit).

And by the way, how does it work in production, are there two servers running for Site.js and SvelteKit or is it somehow merged in to one? (sorry again for a possible silly question)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants