Skip to content
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

Regression from setting tsconfig option moduleResolution to NodeNext #323

Closed
MajorLift opened this issue Jun 6, 2024 · 1 comment · Fixed by #311
Closed

Regression from setting tsconfig option moduleResolution to NodeNext #323

MajorLift opened this issue Jun 6, 2024 · 1 comment · Fixed by #311

Comments

@MajorLift
Copy link
Contributor

References

Error message

src/SnapKeyring.ts:162:13 - error TS2339: Property 'account' does not exist on type 'Json[] | Record<string, Json> | undefined'.

162     const { account, accountNameSuggestion, displayConfirmation } =
                ~~~~~~~

src/SnapKeyring.ts:162:22 - error TS2339: Property 'accountNameSuggestion' does not exist on type 'Json[] | Record<string, Json> | undefined'.

162     const { account, accountNameSuggestion, displayConfirmation } =
                         ~~~~~~~~~~~~~~~~~~~~~

src/SnapKeyring.ts:162:45 - error TS2339: Property 'displayConfirmation' does not exist on type 'Json[] | Record<string, Json> | undefined'.

162     const { account, accountNameSuggestion, displayConfirmation } =
                                                ~~~~~~~~~~~~~~~~~~~

src/SnapKeyring.ts:205:13 - error TS2339: Property 'account' does not exist on type 'Json[] | Record<string, Json> | undefined'.

205     const { account: newAccount } = message.params;
                ~~~~~~~

src/SnapKeyring.ts:234:13 - error TS2339: Property 'id' does not exist on type 'Json[] | Record<string, Json> | undefined'.

234     const { id } = message.params;
                ~~

src/SnapKeyring.ts:276:13 - error TS2339: Property 'id' does not exist on type 'Json[] | Record<string, Json> | undefined'.

276     const { id, result } = message.params;
                ~~

src/SnapKeyring.ts:276:17 - error TS2339: Property 'result' does not exist on type 'Json[] | Record<string, Json> | undefined'.

276     const { id, result } = message.params;
                    ~~~~~~

src/SnapKeyring.ts:297:13 - error TS2339: Property 'id' does not exist on type 'Json[] | Record<string, Json> | undefined'.

297     const { id } = message.params;
                ~~


Found 8 errors in the same file, starting at: src/SnapKeyring.ts:162
@MajorLift MajorLift changed the title Regression from setting tsconfig option moduleResolution to NodeNext Regression ~from setting tsconfig option moduleResolution to NodeNext~ Jun 10, 2024
@MajorLift MajorLift changed the title Regression ~from setting tsconfig option moduleResolution to NodeNext~ Regression Jun 10, 2024
@MajorLift MajorLift changed the title Regression Regression from setting tsconfig option moduleResolution to NodeNext Jun 10, 2024
@MajorLift
Copy link
Contributor Author

MajorLift commented Jun 11, 2024

This issue is caused by "*Struct" types from @metamask/keyring-api resolving to any, because the current version of keyring-api uses superstruct instead of @metamask/superstruct.

Should be resolved by MetaMask/keyring-api#328 being merged and released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant