Skip to content

Unable to build application due to missing type declarations. #415

Closed
@fxnm

Description

@fxnm

Echo Version

2.0.0

Laravel Version

11.41.3

PHP Version

8.3.0

NPM Version

11.1.0 / pnpm: 10.3.0

Database Driver & Version

No response

Description

If trying to build a typescript application where "skipLibCheck": false is set in the tsconfig.json the application fails to build with the following error. The same error also occurs with npm.

> pnpm run build

> tsc && vite build

node_modules/.pnpm/laravel-echo@2.0.0/node_modules/laravel-echo/dist/channel/socketio-channel.d.ts:3:29 - error TS2307: Cannot find module 'socket.io-client' or its corresponding type declarations.

3 import type { Socket } from 'socket.io-client';
                              ~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/laravel-echo@2.0.0/node_modules/laravel-echo/dist/connector/socketio-connector.d.ts:3:33 - error TS2307: Cannot find module 'socket.io-client' or its corresponding type declarations.

3 import type { io, Socket } from 'socket.io-client';
                                  ~~~~~~~~~~~~~~~~~~


Found 2 errors in 2 files.

Errors  Files
     1  node_modules/.pnpm/laravel-echo@2.0.0/node_modules/laravel-echo/dist/channel/socketio-channel.d.ts:3
     1  node_modules/.pnpm/laravel-echo@2.0.0/node_modules/laravel-echo/dist/connector/socketio-connector.d.ts:3
 ELIFECYCLE  Command failed with exit code 2.

Steps To Reproduce

  • Create a laravel application with echo + typescript.
  • Set in the tsconfig.json the option "skipLibCheck": false
  • Try to create a frontend build using npm run build and fail :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions