Skip to content

Cannot find module 'ws' or its corresponding type declarations. #7645

@wade3po

Description

@wade3po

Describe the bug

use npm init @vitejs/app create project, vite version is ^2.8.0, when npm run build,

node_modules/vite/dist/node/index.d.ts:51:47 - error TS2307: Cannot find module 'ws' or its corresponding type declarations.

51 import type { WebSocket as WebSocket_2 } from 'ws';
~~~~
node_modules/vite/dist/node/index.d.ts:52:54 - error TS2307: Cannot find module 'ws' or its corresponding type declarations.

52 import { WebSocketServer as WebSocketServer_2 } from 'ws';
~~~~
Found 2 errors in the same file, starting at: node_modules/vite/dist/node/index.d.ts:51

i need install ws?

Reproduction

no

System Info

no

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions