Industrial
Industrial8mo ago

Deno.serve().shutdown doesn't exist?

const server = Deno.serve({
hostname,
port,
})
server.shutdown()
const server = Deno.serve({
hostname,
port,
})
server.shutdown()
error: TS2339 [ERROR]: Property 'shutdown' does not exist on type 'Server'.
server.shutdown()
error: TS2339 [ERROR]: Property 'shutdown' does not exist on type 'Server'.
server.shutdown()
Running Deno 1.37.2
5 Replies
ioB
ioB8mo ago
It's unstable It does exist if you use --unstable as far as I know
Industrial
Industrial8mo ago
okay
Industrial
Industrial8mo ago
Seems like https://deno.land/api@v1.38.0?s=Deno.serve returns a Deno.HTTPServer not a Deno.Server, which isn't available in the types in VSCode
Deno
Deno.serve | Runtime APIs | Deno
Serves HTTP requests with the given handler.
Industrial
Industrial8mo ago
Ok, it works with unstable
ioB
ioB8mo ago
👍