@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.
@hono/node-serverexposeswsin its public declaration files, butwsis not declared as a dependency.For example,
dist/index.d.mtscontains:However,
wsis currently only adevDependency.This causes TypeScript consumers to fail compilation with:
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
wsis referenced from public.d.ts/.d.mtsfiles, it is effectively part of the package's public type surface and should probably be declared as one of:dependenciespeerDependenciesOtherwise consumers must manually install
ws(and sometimes@types/ws) even if they do not use websocket functionality directly.