Skip to content

Remove warnings about server.ts missing prefixes #17352

Description

@sacrosanctic

Describe the bug

Missing route file prefix. Did you mean +server.ts? at /project/src/routes/server.ts

These are valid files in kit 3 per https://svelte.dev/docs/kit/server-only-modules#Your-modules

Reproduction

.

Logs

System Info

.

Severity

annoyance

Additional Information

No response

Activity

  1. elliott-with-the-longest-name-on-github commented on Oct 5, 2026

    @elliott-with-the-longest-name-on-github
    Contributor

    I'm not actually sure removing the warning is correct; the intended behavior may be for server.ts to be invalid inside the routes directory. If it is actually incorrect, we'd probably want to remove this warning altogether as technically page.ts would be allowed as well.

  2. sacrosanctic commented on Oct 6, 2026

    @sacrosanctic
    ContributorAuthor

    foo.server.ts is allowed inside src/routes. So I would assume server.ts is ok as well.

  3. teemingc commented on Oct 6, 2026

    @teemingc
    Member

    There’s going to be two groups of people: those who did it on purpose and those who did it on accident. I assume we added the warning because an issue was raised about it. Maybe we can make the warning more resilient by checking for the relevant exports before warning

  4. sacrosanctic commented on Oct 6, 2026

    @sacrosanctic
    ContributorAuthor

    On second thought, I don't want to move the warning. But be able to silence the warning when it is intentional.

  5. hyunbinseo commented on Oct 7, 2026

    @hyunbinseo
    Contributor

    Please give an option to silence it. I would love to use this pattern hyunbinseo/svelte-kit-template@ea819f7

    Name remote modules remote.ts or *.remote.ts, outside server/ directories. They export only remote functions — move other exports to separate files:

    src/routes/posts/new/
    ├── save-draft.remote.ts
    └── create-post/
        ├── remote.ts
        ├── server.ts # server-only (e.g. db access)
        └── shared.ts # isomorphic (e.g. schemas)
    

    cc @CheHyeonYeong @Yeonho-Lee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions