Skip to content
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

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

Merged
merged 1 commit into from Aug 31, 2023

Conversation

KarthikRaju391
Copy link
Contributor

@KarthikRaju391 KarthikRaju391 commented Aug 31, 2023

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'. '<LOCAL_PROJECT_DIRECTORY>/node_modules/y-websocket/src/y-websocket.js' implicitly has an 'any' type.
There are types at '<LOCAL_PROJECT_DIRECTORY>/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

@KarthikRaju391 KarthikRaju391 changed the title Update package.json Update exports in package.json to work with typescript Aug 31, 2023
@dmonad dmonad merged commit 2811b0b into yjs:master Aug 31, 2023
0 of 3 checks passed
@dmonad
Copy link
Member

dmonad commented Aug 31, 2023

Thanks!

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.

None yet

2 participants