You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that the TypeScript definitions for Bun.serve() don't properly include the TLSServeOptions interface. The tls property works correctly at runtime, but the TypeScript type checker doesn't recognize it as a valid property.
The issue appears to have been introduced in a recent version of the type definitions. Looking at the code, I see that the serve() function signature doesn't include TLSServeOptions in its union of parameter types.
I've created a reproduction case that confirms this behavior. For now, you can work around this by adding a type assertion:
Bun.serve({
// other options
tls: undefined,
fetch: (req) => new Response("Hello")
} as any);
I'll create a fix for this issue to ensure the tls property is properly typed. Thank you for reporting!
What version of Bun is running?
1.2.4+fd9a5ea66
What platform is your computer?
Microsoft Windows NT 10.0.26120.0 x64
What steps can reproduce the bug?
bun i @types/[email protected]
bun i @types/[email protected]
observe that now typescript throws an error
What is the expected behavior?
tls property should be recognized
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: