File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
packages/accounts-controller/src Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -466,10 +466,12 @@ export class AccountsController extends BaseController<
466466 } ;
467467
468468 this . update ( ( state ) => {
469- // FIXME: Do not remove this comment - This error is flaky: Comment out or restore the `ts-expect-error` directive below as needed.
470- // See: https://github.com/MetaMask/utils/issues/168
471- // // @ts -expect-error Known issue - `Json` causes recursive error in immer `Draft`/`WritableDraft` types
472- state . internalAccounts . accounts [ accountId ] = internalAccount ;
469+ // FIXME: Using the state as-is cause the following error: "Type instantiation is excessively
470+ // deep and possibly infinite.ts(2589)" (https://github.com/MetaMask/utils/issues/168)
471+ // Using a type-cast workaround this error and is slightly better than using a @ts-expect-error
472+ // which sometimes fail when compiling locally.
473+ ( state as AccountsControllerState ) . internalAccounts . accounts [ accountId ] =
474+ internalAccount ;
473475 } ) ;
474476
475477 if ( metadata . name ) {
You can’t perform that action at this time.
0 commit comments