Closed justintaddei closed 6 years ago
should it not?
This is how typescript works, when you do import foo from 'bar'
it expects to import the default export from bar
and name it foo
. Because ws
doesn't have a default export it will fail.
You should be using import * as WebSocket from 'ws'
See https://www.typescriptlang.org/docs/handbook/modules.html for more info
Not sure if this is a bug or if I'm doing something wrong here.
The
ws
module exportsWebSocket
like so:I'm importing
WebSocket
from thews
module like so:Seems fine, right? Well, it is being compiled to the following:
The problem is that
ws_1.default
isundefined
. It should be compiled tows_1.Server
, should it not?