scopsy / await-to-js

Async await wrapper for easy error handling without try-catch
http://blog.grossman.io/how-to-write-async-await-without-try-catch-blocks-in-javascript/
MIT License
3.25k stars 153 forks source link

Error while using KnexJS #29

Closed thevirajshelke closed 5 years ago

thevirajshelke commented 5 years ago
let [err, data] = await to(
    knex('temp').insert({
        // some code
    })
  )
"Argument of type 'QueryBuilder' is not assignable to parameter of type 'Promise<any>'.
  Property '[Symbol.toStringTag]' is missing in type 'QueryBuilder' but required in type 'Promise<any>'."

I checked some closed issues and it seems that #21 had solved this. I have checked the commit history and now it seems to have reverted back to Promise<T>.

So any workaround for this scenario? @scopsy

thevirajshelke commented 5 years ago

I think the issue was with Knex's type definitions. It's working fine as of now :) 👍