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

Open
@foligny

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!

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