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

Route named home is substantially slower in both SvelteKit, Astro, and possibly other frameworks (in dev mode) #16481

Open
7 tasks done
dihmeetree opened this issue Apr 21, 2024 · 1 comment
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority)

Comments

@dihmeetree
Copy link

dihmeetree commented Apr 21, 2024

Describe the bug

For some reason, if you create a route named home, it will take much longer to load than any other route (For example /test and containing the same content). This has been reproduced with both SvelteKit and Astro frameworks) in dev mode.

Note: This issue does not exist in production/preview (built/compiled) sites.

I've created an issue thread in the SvtelteKit repo for this issue sveltejs/kit#12061 (comment). I figured this was a SvelteKit issue at first, but it looks like this may be related to Vite (as user amit13k points out in the comment above)

If you're apart of the SvelteKit Discord, you can see our conversation here regarding the bug: https://discord.com/channels/457912077277855764/1223280626724241439

This issue seems to definitely affect Mac users. I've had 1 user say that they weren't affected on Linux, however another has said that they had the issue on Windows.

Reproduction

You can use my repo below, or just use the quickstart commands to create a project for both SvelteKit and Astro (included below)
https://github.com/dihmeetree/svelte-bug-repro

Steps to reproduce

You can create a SvelteKit project quickly via the following command

npm create svelte@latest my-app

In SvelteKit create a route (folder) named home, and create a +page.svelte file inside it. Put some html in it and then load the /home route in your browser. Create a /test folder as well. The /home route will load much slower than the /test route.

And for Astro

npm create astro@latest

In Astro create a home.astro file in the pages directory. It will be much slower than your index.astro file.

I've tested with npm, yarn, and bun to make sure it wasn't an issue with a package manager as well.

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 19.58 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.0 - /usr/local/bin/node
    npm: 10.5.0 - /usr/local/bin/npm
    bun: 1.1.3 - /usr/local/bin/bun
  Browsers:
    Chrome: 124.0.6367.61
    Safari: 17.4.1

Used Package Manager

bun

Logs

No logs that are relevant to the issue.

Validations

@dihmeetree dihmeetree changed the title Route named home is substantially slower on both SvelteKit, Astro, and possibly other frameworks Route named home is substantially slower in both SvelteKit, Astro, and possibly other frameworks Apr 21, 2024
@dihmeetree dihmeetree changed the title Route named home is substantially slower in both SvelteKit, Astro, and possibly other frameworks Route named home is substantially slower in both SvelteKit, Astro, and possibly other frameworks (in dev environment) Apr 21, 2024
@dihmeetree dihmeetree changed the title Route named home is substantially slower in both SvelteKit, Astro, and possibly other frameworks (in dev environment) Route named home is substantially slower in both SvelteKit, Astro, and possibly other frameworks (in dev mode) Apr 21, 2024
@bluwy
Copy link
Member

bluwy commented Apr 29, 2024

I haven't looked into the issue much yet, but if accessing /home once is really slow, we might need to skip it on MacOS. Otherwise if it's only slow in repeated access, we might need to check if it's a caching issue so we only do it once.

@bluwy bluwy added p2-edge-case Bug, but has workaround or limited in scope (priority) and removed pending triage labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority)
Projects
None yet
Development

No branches or pull requests

2 participants