-
-
Notifications
You must be signed in to change notification settings - Fork 167
fix: add "types" field to conditional exports #470
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Related to #462 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's been more than a month now, someone had to do it to stop the PR from stagnating :)
Yea the types in this package doesn't work. In my vscode it says:
This with native ESM support. When I was using CJS, I could directly import the type files, hacking around the |
These are the types I care about:
They used to work when I was using CJS. Now I'm transitioning to ESM, and the last 2 imports no longer work. |
Co-authored-by: Altrue <9656008+Altrue@users.noreply.github.com>
@Altrue @tien Ah, thank you. I must admit I didn't test that as a required ordering to fields in JSON doesn't really make sense. I can't quite remember why I was running into this issue anymore ( |
@andywer are you still working on this? Without this PR I think ESM downstream projects can't use this. And I actually care about these types: #470 (comment) |
Hi @andywer, |
Hi @Anton-Plagemann & @TomAFrench, sorry for the unresponsiveness! Will merge right away. |
Tests are broken, unfortunately. Updated some dependencies on https://github.com/andywer/threads.js/tree/chore/fix-ci, but still have an issue with a worker in a browser. The statically deployed worker script doesn't exist anymore… 😕 |
@andywer hi. |
@oxcl If someone could fix the build, that would be amazing. I could also build and publish despite the failing test, but we should definitely fix this in the mid-term. |
@andywer I just ran |
@oxcl Very hard to believe. The worker script deployment doesn't exist anymore: threads.js/test-tooling/webpack/app.ts Line 41 in 5f9a15f
Unfortunately, I also don't know if I have the code anywhere else, but I think it was just the transpiled and bundled |
I'm experiencing a lot of issues when trying to resolve the types
The last error explicitly calls out that changes need to be made to the threads.js
package.json
. I've then added a "types" field for each of the conditional exports.