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
Originally reported in the webpack repo: webpack/webpack#18242 this appears to actually be a broken type here. When trying to assign an IFs object to a prop of fs type, we get an error about writeFile and the WriteFileOptions type not matching. Seems like the overloads are off a bit.
Type 'IFs' is not assignable to type 'OutputFileSystem'.
Types of property 'writeFile' are incompatible.
Type '{ (id: TFileId, data: TData, callback: TCallback<void>): any; (id: TFileId, data: TData, options: string | IWriteFileOptions, callback: TCallback<...>): any; }' is not assignable to type 'WriteFile'.
Types of parameters 'callback' and 'options' are incompatible.
Type 'WriteFileOptions' is not assignable to type 'TCallback<void>'.
Type 'null' is not assignable to type 'TCallback<void>'.ts(2322)
(property) Compiler.outputFileSystem: OutputFileSystem | null
Tested with the latest version of memfs (4.8.1)
The text was updated successfully, but these errors were encountered:
michaelfaith
changed the title
TypeScript incompatibility for writeFile
Type incompatibility for writeFileApr 3, 2024
Originally reported in the
webpack
repo: webpack/webpack#18242 this appears to actually be a broken type here. When trying to assign anIFs
object to a prop of fs type, we get an error aboutwriteFile
and theWriteFileOptions
type not matching. Seems like the overloads are off a bit.Tested with the latest version of
memfs
(4.8.1)The text was updated successfully, but these errors were encountered: