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.

error TS2344: Type 'Modifiers' does not satisfy the constraint 'SelectModifiers'.

See original GitHub issue

The code built by running yarn edgeql-js has typescript errors.

Schema

Your application schema.

module default {
  type Person {
    required property first_name -> str;
    property last_name -> str;
    property full_name :=
      .first_name ++ ' ' ++ .last_name
      if exists .last_name
      else .first_name;
  }

  type Movie {
    required property title -> str;
    property release_year -> int64;
    multi link actors -> Person;
    link director -> Person;
  }
};

Generated EdgeQL

not relevant, can’t compile

Error or desired behavior

Error: after running tsc command

dbschema/edgeql-js/syntax/select.ts:715:51 - error TS2344: Type 'Modifiers' does not satisfy the constraint 'SelectModifiers'.

715   __cardinality__: ComputeSelectCardinality<Expr, Modifiers>;
                                                      ~~~~~~~~~

  dbschema/edgeql-js/syntax/select.ts:703:3
    703   Modifiers = Pick<Shape, SelectModifierNames>
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    This type 

Expected: the ts library generated by edgeql-js should compile as valid ts

Versions (please complete the following information):

  • OS: MacOS 12.5.1
  • EdgeDB version: 2.1
  • “edgedb”: “^0.22.1”,
  • “edgeql-js”: “^1.0.0”,

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
colinhackscommented, Sep 4, 2022

This appears to be a TS4.8 regression (unrelated to the edgedb@0.22.1 release). Fix published in edgedb@0.22.2.

1reaction
dotlouiscommented, Sep 2, 2022

Ran into the same issue. For a temporary fix, you can change the line

 __cardinality__: ComputeSelectCardinality<Expr, Modifiers>

into

 __cardinality__: ComputeSelectCardinality<Expr, SelectModifiers>
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 >
Error TS2344: Type 'T[K]' does not satisfy the constraint
I found the core of the problem, my Ng version is 7.3.9 and AngularFire was 6.0.0 I had to downgrade the version to...
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 >
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 >
Getting some compilation errors while compiling the TS files in ...
node_modules/@types/jquery/index.d.ts:6107:66 - error TS2344: Type '"timeout" ... "withCredentials" | "msCaching"' does not satisfy the constraint '"open" ...
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