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
Argument of type '() => Buffer | string' is not assignable to parameter of type '{ (path: PathOrFileDescriptor, options?: { encoding?: null | undefined; flag?: string | undefined; } | null | undefined): Buffer; (path: PathOrFileDescriptor, options: BufferEncoding | { ...; }): string; (path: PathOrFileDescriptor, options?: (ObjectEncodingOptions & { ...; }) | ... 2 more ... | undefined): string |...'.
Type 'string | Buffer' is not assignable to type 'Buffer'.
Type 'string' is not assignable to type 'Buffer'.
Describe the bug
I found #6085 and have a very similar issue.
So I thought it would have been solved by #6086. But unfortunately I'm still running into issues.
This actually looks to be a regression introduced with 2.0.3
Here it is without any TS errors with 2.0.2 https://stackblitz.com/edit/vitest-dev-vitest-vmu2hy?file=test%2Fbasic.test.ts
And here it is with 2.0.3: https://stackblitz.com/edit/vitest-dev-vitest-huxpgg?file=test%2Fbasic.test.ts
This is my code (also available at the above StackBlitz links)
(With inlined error messages)
And in text form, for easier Google indexing:
With
string
Error:
Trying
Buffer
instead, as that's what suggested by the error messageError:
Trying the combination of
Buffer | string
as that's what the actual implementation hasError:
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-huxpgg?file=test%2Fbasic.test.ts
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: