After migrating to Sapphire v4 and D.js v14 and fixed all breaking changes, I've still got three errors from
@sapphire/result
@sapphire/result
One of the error is:
node_modules/@sapphire/result/dist/lib/Option.d.ts:45:46 - error TS2344: Type 'T[P]' does not satisfy the constraint 'Option<any>'. Type 'T[keyof T]' is not assignable to type 'Option<any>'. Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'Option<any>'. Type 'T[string]' is not assignable to type 'Option<any>'. Type 'T[string]' is not assignable to type 'Some<any>'. Type 'T[keyof T]' is not assignable to type 'Some<any>'. Type 'T[P]' is not assignable to type 'Some<any>'. Type 'T[keyof T]' is not assignable to type 'Some<any>'. Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'Some<any>'. Type 'T[string]' is not assignable to type 'Some<any>'. 45 -readonly [P in keyof T]: UnwrapSome<T[P]>;
node_modules/@sapphire/result/dist/lib/Option.d.ts:45:46 - error TS2344: Type 'T[P]' does not satisfy the constraint 'Option<any>'. Type 'T[keyof T]' is not assignable to type 'Option<any>'. Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'Option<any>'. Type 'T[string]' is not assignable to type 'Option<any>'. Type 'T[string]' is not assignable to type 'Some<any>'. Type 'T[keyof T]' is not assignable to type 'Some<any>'. Type 'T[P]' is not assignable to type 'Some<any>'. Type 'T[keyof T]' is not assignable to type 'Some<any>'. Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'Some<any>'. Type 'T[string]' is not assignable to type 'Some<any>'. 45 -readonly [P in keyof T]: UnwrapSome<T[P]>;
The other two looks the same but instead of
UnwrapSome
UnwrapSome
there's
UnwrapOk
UnwrapOk
and
UnwrapErr
UnwrapErr
in the last row How to fix this?
Solution
Anyway I think the reason for your issue might be that you haven't updated TypeScript, so try updating it to 4.9.4