Route param matcher can not be reserved keyword
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the bug
In the client, a route param matcher in src/params cannot be a reserved keyword. For example, src/params/function.ts fails on the client (it works on the server). The expected behavior is to throw a helpful error. Currently, the error (on Firefox) is an internal error with no stack trace:
Uncaught (in promise) InternalError: module record has unexpected status: New
Reproduction
Simply add an empty file called src/routes/function.(js|ts) to a SvelteKit project and load the project in the browser.
Logs
System Info
System:
OS: macOS 14.6.1
CPU: (10) arm64 Apple M1 Pro
Memory: 130.94 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.12.0
Yarn: 1.22.19
npm: 10.9.0
pnpm: 10.13.1
Browsers:
Firefox: 143.0.4
npmPackages:
@sveltejs/adapter-auto: ^6.0.0 => 6.1.1
@sveltejs/kit: ^2.47.1 => 2.47.2
@sveltejs/vite-plugin-svelte: ^6.2.1 => 6.2.1
svelte: ^5.41.0 => 5.41.0
vite: ^7.1.10 => 7.1.10
Severity
annoyance
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the client failure with an empty src/routes/function.(js|ts) route, then inspect the route parameter matcher in src/params and the example src/params/function.ts. The fix is done when this reserved keyword produces a helpful error in the client instead of Firefox's internal module error, while the matcher continues to work on the server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100