-
-
Notifications
You must be signed in to change notification settings - Fork 184
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 "types"
to "exports"
#2803
Conversation
When trying to use `fast-check` with TypeScript where `moduleResolution` is set to `Node12` or `NodeNext` we get the following error: > Could not find a declaration file for module 'fast-check'. '/home/makeen/q2web/Dev/openapi-codegen/node_modules/fast-check/lib/esm/fast-check.js' implicitly has an 'any' type. > Try `npm i --save-dev @types/fast-check` if it exists or add a new declaration (.d.ts) file containing `declare module 'fast-check';`ts(7016) This change fixes the issue. I think this might be related: microsoft/TypeScript#46334
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 7010277:
|
Codecov Report
@@ Coverage Diff @@
## main #2803 +/- ##
=======================================
Coverage 95.08% 95.08%
=======================================
Files 214 214
Lines 5023 5023
Branches 1000 1000
=======================================
Hits 4776 4776
Misses 243 243
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
Thank you so much for the fix @Osman-Sodefa! I'll probably need to cover it as I did for other esm-related stuff in https://github.com/dubzzz/fast-check/tree/main/test/esm. Is there a specific version you need the fix in? I mean which version do you need to include the fix? |
No specific version. I'm currently using the latest of |
2.23.1 is on its way 🚀 You can track the deployment on https://github.com/dubzzz/fast-check/actions/runs/2000117810 |
Though I think it's more TS related than ESM related. |
I mean I put all the environment related issues into this directory. It's probably not well labeled 😂 |
It will probably not work yet! I'll need to do the exact same fix for pure-rand 🤔 See the error I got when trying to add a dedicated test: Error: node_modules/fast-check/lib/types/random/generator/PureRandom.d.ts(1,60): error TS7016: Could not find a declaration file for module 'pure-rand'. '/home/runner/work/fast-check/fast-check/test/type/node_modules/fast-check/node_modules/pure-rand/lib/pure-rand.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/pure-rand` if it exists or add a new declaration (.d.ts) file containing `declare module 'pure-rand';`
Error: Process completed with exit code 2. |
Same issue as the one reported at dubzzz/fast-check#2803
I have enabled |
I'll update it on my side so that the whole fast-check + pure-rand gets fixed! Thanks a lot for the report and the fix! |
Same issue as the one reported at dubzzz/fast-check#2803
When trying to use
fast-check
with TypeScript wheremoduleResolution
is set toNode12
orNodeNext
we get the following error:This change fixes the issue.
I think this might be related: microsoft/TypeScript#46334
Category:
Potential impacts: