Skip to content

TS2709: Cannot use namespace Serve as a type. #25409

@mnpenner

Description

@mnpenner

What version of Bun is running?

1.3.4+5eb2145b3

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

Copy your own example verbatim:

import { type Serve } from "bun";

export default {
  fetch(req) {
    return new Response("Bun!");
  },
} satisfies Serve;

From https://bun.com/docs/runtime/http/server#export-default-syntax

What is the expected behavior?

No TypeScript errors

What do you see instead?

Image

TS2709: Cannot use namespace Serve as a type.

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtypesAn issue with TypeScript types

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions