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

Did you find this page helpful?