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

Add link to types #490

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mmamedel
Copy link

When you open the library on a Typescript project, I get the following error message on VSCode:

Could not find a declaration file for module 'threads'. '/home/mlage/test/test-threadsjs/node_modules/.pnpm/threads@1.7.0_patch_hash=eohjd6xpj3mgfbvhyvlcjihlim/node_modules/threads/index.mjs' implicitly has an 'any' type.
  There are types at '/home/mlage/test/test-threadsjs/node_modules/threads/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'threads' library may need to update its package.json or typings.ts(7016)

This is just updating the package.json to fix this.
Thank you

@blordpluto
Copy link

My team uses TypeScript, and while this library looks great so far, this is a blocker for us.

There hasn't been a release in years. Is this project still being maintained? 🤔 We are reluctant to fork something for the sake of merging a single PR.

@nickythorne
Copy link

Bump on this also a blocker for us.

Workaround for now:

Either use patch-package as a postinstall script if using npm or yarn. Otherwise use pnpm patch to apply this package.json change (what we decided to do).

@mmamedel
Copy link
Author

mmamedel commented Jun 1, 2024

Honestly what we ended up doing was just writing some helpers to allow using native postMessage and message events with Typescript. Felt more future secure than working with this package. And being the native types, it is all well documented. Let me know if you would be interested, I can put these helper types in a package with a README of how to use them.

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

3 participants