Code Monkey home page Code Monkey logo

kysely-tsc-error's Introduction

To reproduce:

  1. Clone this repository
  2. npm i
  3. npm run check

Error in question:

> [email protected] check
> tsc

src/countries.ts:7:27 - error TS2322: Type 'OnConflictUpdateBuilder<OnConflictDatabase<DB, "countries">, OnConflictTables<"countries">>' is not assignable to type 'OnConflictDoNothingBuilder<DB, "countries"> | OnConflictUpdateBuilder<DB, "countries">'.
  Type 'OnConflictUpdateBuilder<OnConflictDatabase<DB, "countries">, OnConflictTables<"countries">>' is not assignable to type 'OnConflictUpdateBuilder<DB, "countries">'.
    Types of property 'where' are incompatible.
      Type '{ <RE extends ReferenceExpression<OnConflictDatabase<DB, "countries">, OnConflictTables<"countries">>>(lhs: RE, op: ComparisonOperatorExpression, rhs: OperandValueExpressionOrList<...>): OnConflictUpdateBuilder<...>; (factory: WhereExpressionFactory<...>): OnConflictUpdateBuilder<...>; (expression: Expression<...>):...' is not assignable to type '{ <RE extends ReferenceExpression<DB, "countries">>(lhs: RE, op: ComparisonOperatorExpression, rhs: OperandValueExpressionOrList<DB, "countries", RE>): OnConflictUpdateBuilder<...>; (factory: WhereExpressionFactory<...>): OnConflictUpdateBuilder<...>; (expression: Expression<...>): OnConflictUpdateBuilder<...>; }'.
        Types of parameters 'factory' and 'factory' are incompatible.
          Types of parameters 'eb' and 'eb' are incompatible.
            Type 'WhereExpressionBuilder<OnConflictDatabase<DB, "countries">, OnConflictTables<"countries">>' is not assignable to type 'WhereExpressionBuilder<DB, "countries">'.
              Types of property 'where' are incompatible.
                Type '{ <RE extends ReferenceExpression<OnConflictDatabase<DB, "countries">, OnConflictTables<"countries">>>(lhs: RE, op: ComparisonOperatorExpression, rhs: OperandValueExpressionOrList<...>): WhereExpressionBuilder<...>; (grouper: WhereExpressionBuilder<...>): WhereExpressionBuilder<...>; (expression: Expression<...>): W...' is not assignable to type '{ <RE extends ReferenceExpression<DB, "countries">>(lhs: RE, op: ComparisonOperatorExpression, rhs: OperandValueExpressionOrList<DB, "countries", RE>): WhereExpressionBuilder<...>; (grouper: WhereExpressionBuilder<...>): WhereExpressionBuilder<...>; (expression: Expression<...>): WhereExpressionBuilder<...>; }'.
                  Types of parameters 'grouper' and 'grouper' are incompatible.
                    Type 'WhereExpressionBuilder<DB, "countries">' is not assignable to type 'WhereExpressionBuilder<OnConflictDatabase<DB, "countries">, OnConflictTables<"countries">>'.
                      Types of property 'whereRef' are incompatible.
                        Type '(lhs: ReferenceExpression<DB, "countries">, op: ComparisonOperatorExpression, rhs: ReferenceExpression<DB, "countries">) => WhereExpressionBuilder<...>' is not assignable to type '(lhs: ReferenceExpression<OnConflictDatabase<DB, "countries">, OnConflictTables<"countries">>, op: ComparisonOperatorExpression, rhs: ReferenceExpression<...>) => WhereExpressionBuilder<...>'.
                          Types of parameters 'lhs' and 'lhs' are incompatible.
                            Type 'ReferenceExpression<OnConflictDatabase<DB, "countries">, OnConflictTables<"countries">>' is not assignable to type 'ReferenceExpression<DB, "countries">'.
                              Type '"excluded.id"' is not assignable to type 'ReferenceExpression<DB, "countries">'.

  7         .onConflict(oc => oc
                              ~~
  8             .column('id')
    ~~~~~~~~~~~~~~~~~~~~~~~~~
...
 10                 id: eb.ref('excluded.id')
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 11             }))
    ~~~~~~~~~~~~~~~

  node_modules/kysely/dist/esm/query-builder/insert-query-builder.d.ts:371:26
    371     onConflict(callback: (builder: OnConflictBuilder<DB, TB>) => OnConflictDoNothingBuilder<DB, TB> | OnConflictUpdateBuilder<DB, TB>): InsertQueryBuilder<DB, TB, O>;
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.


Found 1 error in src/countries.ts:7

kysely-tsc-error's People

Contributors

virtuallyunknown avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.