Skip to content

Public declaration files reference undeclared dependency ws #353

@heroboy

Description

@heroboy

@hono/node-server exposes ws in its public declaration files, but ws is not declared as a dependency.

For example, dist/index.d.mts contains:

import { WebSocket, WebSocketServer } from "ws";

However, ws is currently only a devDependency.

This causes TypeScript consumers to fail compilation with:

TS2307: Cannot find module 'ws' or its corresponding type declarations.

This is reproducible under pnpm / NodeNext module resolution, but the issue is not pnpm-specific — consumers are not expected to install a package's devDependencies.

Since ws is referenced from public .d.ts/.d.mts files, it is effectively part of the package's public type surface and should probably be declared as one of:

  • dependencies
  • peerDependencies
  • optional peer dependency

Otherwise consumers must manually install ws (and sometimes @types/ws) even if they do not use websocket functionality directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions