Skip to content

How to handle Typescript correctly ? error TS2339: Property 'ws' does not exist on type ... node_modules/@types/koa/index.d.ts")<DefaultState, DefaultContext>' #231

Description

@foligny

Hi

I added koa-websocket to my project, and it works well at runtime. But Typescript type check complains about

error TS2339: Property 'ws' does not exist on type 'import("/home/frank/dev/task-runner/node_modules/@types/koa/index.d.ts")<DefaultState, DefaultContext>'.

for the code (which runs fine)

app.ws.use(
  route.all('/', (ctx: any) => {

Any idea how to resolve it ?
Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions