Industrial
Industrial9mo 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
ioB9mo ago
It's unstable It does exist if you use --unstable as far as I know
Industrial
Industrial9mo ago
okay
Industrial
Industrial9mo 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
Industrial9mo ago
Ok, it works with unstable
ioB
ioB9mo ago
👍