You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
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).
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When you open the library on a Typescript project, I get the following error message on VSCode:
This is just updating the
package.jsonto fix this.Thank you