Open dihmeetree opened 8 months ago
Does this need more context? Please let me know if so. You actually don't even need to clone my repo. I noticed that any SvelteKit app with a route named home
will reproduce the bug (you can can even reproduce it with the npm create svelte@latest my-app
command)
I don't see any difference in loading time between both routes in your example (dev mode). Check from another browser and/or computer.
I don't see any difference in loading time between both routes in your example (dev mode). Check from another browser and/or computer.
Did you test on Windows or Mac? I just tested on a Lightsail VPS running Windows and it definitely seems to not be as bad as when running on a Mac. It may be something related to that.
Did you test on Windows or Mac? I just tested on a Lightsail VPS running Windows and it definitely seems to not be as bad as when running on a Mac. It may be something related to that.
Tested on chrome/firefox linux. My first bet would be Safari or one of its extension (adblocker?), try with another route named advertising
or something like this.
Did you test on Windows or Mac? I just tested on a Lightsail VPS running Windows and it definitely seems to not be as bad as when running on a Mac. It may be something related to that.
Tested on chrome/firefox linux. My first bet would be Safari or one of its extension (adblocker?), try with another route named
advertising
or something like this.
I use Chrome on Mac. Tested in Safari (No ad blocker) and I get the same result. I had another user (In the Svelte Discord) confirm the slowness as well (https://discord.com/channels/457912077277855764/1223280626724241439) Waiting to hear back from them on whether they use Mac or not (I'm assuming yes)
Edit: Confirmed, yes they are on Mac.
This seems to be related to vite. I get similar issue in astro on Mac. After debugging a bit i found, vite does a few things whenever /home route is accessed.
const stat = fs.statSync("/home")
stat.isFile()
stat.isDirectory()
fs.existsSync("/home/package.json")
which is too slow for some reason on MacOS. I don't know/understand if it's necessary for vite to do this.
Thank you @amit13k for pointing out that this issue also exists in the Astro framework as well, so this is most likely a Vite issue. An issue thread has been created here https://github.com/vitejs/vite/issues/16481
Describe the bug
If you name a route
/home
it will cause the page to load much slower (~300ms for me), however if you create a route named/test
for example (in the same directory), it will load quickly (~35ms). Not sure if it is only the wordhome
, or if it also involves other keywords as well. There's nothing in my code that would cause/home
to load slower than other routes either (hooks, etc).I had another member of the Discord also test on their machine, and they confirmed the issue as well.
Note: This does only seem to be a development mode issue, there is not lag/delay after the site is built and in production.
Reproduction
I've created a minimal reproduction here https://github.com/dihmeetree/svelte-bug-repro
Logs
No response
System Info
Severity
annoyance
Additional Information
No response