question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type 'Balance' does not satisfy the constraint 'CompactEncodable'.

See original GitHub issue

Seeing this error when running tsc appear after upgrading to v1.1.1

Type 'Balance' does not satisfy the constraint 'CompactEncodable'.

Complains about missing toNumber

215   public get tip (): Compact<Balance> {
                                 ~~~~~~~

  node_modules/@polkadot/types/codec/Compact.d.ts:9:5
    9     toNumber(): number;
          ~~~~~~~~~~~~~~~~~~~
    'toNumber' is declared here.

Seems like some typescript inference is missing

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jacogrcommented, Feb 18, 2020

PS: 1.2.1 does have a dependency gap (fixed in master) where it needs @types/bn.js installed as well (the dep was not listed). Just a heads up.

0reactions
polkadot-js-botcommented, Jun 4, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error "Type 'S' does not satisfy the constraint 'IValueMap'" with ...
1 in a project that uses TypeScript 4.8, I get the following compiler error: node_modules/mobx-react/dist/inject.d.ts:5:63 - error TS2344: Type ...
Read more >
Type 'S' does not satisfy the constraint 'JSONSchema' in ...
It's because your type ValidatedAPIGatewayProxyEvent<S> takes a type argument S , with no constraints, but then passes it into FromSchema<S> ...
Read more >
Incorrect, "Type does not satisfy the constraint" error when ...
Incorrect, "Type does not satisfy the constraint" error when using constraints with primitive types ... The following code is in fact valid, compiles...
Read more >
Typescript error "does not satisfy the constraint new" when ...
Integrating with an API where a boolean can only be undefined or true I needed to type it. It's easy enough but I...
Read more >
Why is my Pick<> failing with "Type does not satisfy ... - Reddit
I have a file called ionIcons.ts. It contains a list of var delcarations. export declare var accessibility: string; export declare var…
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found