sveltejs / sveltejs/kit

`+server.ts` route inside `.well-known` is not type-checked

Open
#14,138 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

types / typescript
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

I have a +server.ts file here src/routes/(search_engines)/.well-known/assetlinks.json/+server.ts.

It's contents are not correctly typechecked.
Neither by my LSP, nor by pnpm run check.


As you can see inside my editor it does not interpret the contents correctly. Which is weird, because inside the "neighbouring file" src/routes/(search_engines)/robots.txt/+server.ts everything is typechecked as expected.

Image

Not only imports are affected, but also pain syntax errors, such as using a variable that was never defined.

Reproduction

--

Logs

System Info
System:
    OS: macOS 15.5
    CPU: (20) x64 Intel(R) Xeon(R) W-2150B CPU @ 3.00GHz
    Memory: 792.44 MB / 64.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 24.5.0 - /usr/local/bin/node
    Yarn: 1.22.11 - /usr/local/bin/yarn
    npm: 11.5.1 - /usr/local/bin/npm
    pnpm: 10.13.1 - /usr/local/bin/pnpm
    bun: 1.0.25 - /usr/local/bin/bun
  Browsers:
    Chrome: 138.0.7204.184
    Safari: 18.5
  npmPackages:
    @sveltejs/adapter-node: ^5.2.13 => 5.2.13 
    @sveltejs/adapter-static: ^3.0.8 => 3.0.8 
    @sveltejs/enhanced-img: ^0.6.1 => 0.6.1 
    @sveltejs/kit: 2.27.0 => 2.27.0 
    @sveltejs/vite-plugin-svelte: ^6.1.0 => 6.1.0 
    svelte: 5.37.3 => 5.37.3 
    vite: ^7.0.6 => 7.0.6
Severity

serious, but I can work around it

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing type-checking for src/routes/(search_engines)/.well-known/assetlinks.json/+server.ts with the neighboring src/routes/(search_engines)/robots.txt/+server.ts. Run pnpm run check and inspect the generated or checked route information for both files. Done means imports, undefined variables, and other TypeScript errors in the assetlinks route are reported correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, testing-qa, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.