Skip to content

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/[email protected]_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.

@andywer
Copy link
Owner

andywer commented Jun 19, 2024

Duplicate of merged #470.

@andywer andywer closed this Jun 19, 2024
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.

4 participants