-
Notifications
You must be signed in to change notification settings - Fork 735
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
fix: type errors when playwright
is not installed
#1637
Conversation
Do we also need crawlee/scripts/typescript_fixes.mjs Lines 18 to 28 in 7a2217d
Doesn't |
Does this supersede #1629? 👀 |
Nope, it'll still throw an error like importing without the |
Shouldn't we use Edit: yep importing non-installed package throws. That's gonna be a separate task I guess. |
Tested this locally and it works 🎉 |
playwright
is not installed
* This is required when using optional dependencies. | ||
* Importing a type gives `any`, but `Parameters<any>` gives `unknown[]` instead of `any` | ||
*/ | ||
export type SafeParameters<T extends (...args: any) => any> = unknown[] extends Parameters<T> ? any : Parameters<T>; |
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.
we should move this to @crawlee/types
(probably), and mark it as @internal
(definitely)
Fixes #1610
Closes #1629