Skip to content

[2.x] Fix TS errors with skipLibCheck: false #416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

SanderMuller
Copy link
Contributor

Fix TS errors with skipLibCheck: false by adding typesVersions

This PR fixes TypeScript module resolution errors that occur when a project has skipLibCheck: false set.

Currently, if socket.io-client or pusher-js are not installed, TypeScript still attempts to resolve them, leading to errors like:
TS2307: Cannot find module 'socket.io-client' or its corresponding type declarations.

Fix

  • Added typesVersions in package.json to exclude socket.io-client and pusher-js from type resolution when missing.
  • This prevents TypeScript from enforcing type checks on optional dependencies.

No Breaking Changes

This only affects TypeScript behavior and does not impact runtime or bundled output.

Closes

Fixes #415

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…skipLibCheck:false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to build application due to missing type declarations.
2 participants