yjs / y-websocket

Websocket Connector for Yjs
https://docs.yjs.dev/ecosystem/connection-provider/y-websocket
MIT License
492 stars 255 forks source link

Update exports in package.json to work with typescript #149

Closed KarthikRaju391 closed 11 months ago

KarthikRaju391 commented 11 months ago

There is a bug when using y-websocket with typescript where typescript can't find the required types of the library because it isn't exported in the package.json file of the library.

This is the error:

Could not find a declaration file for module 'y-websocket'. '/node_modules/y-websocket/src/y-websocket.js' implicitly has an 'any' type. There are types at '/node_modules/y-websocket/dist/src/y-websocket.d.ts', but this result could not be resolved when respecting package.json "exports". The 'y-websocket' library may need to update its package.json or typings.ts(7016)

By making this change, I was able to fix the error.

It might also be related to the issue #72

dmonad commented 11 months ago

Thanks!