Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upProperty 'timeout' does not exist on type 'QueryBuilder' #3422
Comments
This comment has been minimized.
This comment has been minimized.
It was a bluebird method. We no longer support bluebird. |
This comment has been minimized.
This comment has been minimized.
Same issue with the map - property. It works with 0.17.6 knex but breaks with 0.18.0 and newer.
|
This comment has been minimized.
This comment has been minimized.
IIRC http://knexjs.org/#Builder-timeout is not from bluebird, but actually implemented in knex. It actually cancels the query if timeout is triggered. |
This comment has been minimized.
This comment has been minimized.
@Heikkohoo |
This comment has been minimized.
This comment has been minimized.
@kibertoad thanks. Got the .map thinghy working. |
This comment has been minimized.
This comment has been minimized.
@3mini Types were fixed in 0.19.4 that was just published. |
This comment has been minimized.
This comment has been minimized.
@kibertoad Thanks |
This comment has been minimized.
This comment has been minimized.
@lorefnon There's still a compile error as below.
According to the document, the second argument is optional as in the example.
But Instead of an empty option ( (If it need more options,
What do you think? |
This comment has been minimized.
This comment has been minimized.
I'm having the same error as in the title.
Is there a way to use Bluebird as my project's Promise and still use Knex? |
This comment has been minimized.
This comment has been minimized.
@yigaldviri |
This comment has been minimized.
This comment has been minimized.
I wonder if signature will become compatible if we make options an optional argument. I see no reasons why not to. @lorefnon, what do you think? |
This comment has been minimized.
This comment has been minimized.
@kibertoad - the thing is that i do "expect Knex to return Bluebird promises to you". I'm using Bluebird instead of native Promises sort of like this: Also, I'm using async/await and don't have a problem with Bluebird |
This comment has been minimized.
This comment has been minimized.
@yigaldviri Right, so that forces all calls to |
This comment has been minimized.
This comment has been minimized.
In response to @3mini's comment we had already made the options argument optional, and it was released in 0.20.0. However with 0.20.0 the error reported by @yigaldviri should not be possible (absent external interference with types) because ChainableInterface no longer extends Bluebird so @yigaldviri Can you please let us know if any of the following are true:
As @kibertoad mentioned, we have found global promise->bluebird substitution to not be a viable solution because irrespective of what you set |
This comment has been minimized.
This comment has been minimized.
Hi @lorefnon ,
|
- Update QueryInterface to proxy to only standard promise methods - Update QueryInterface type to be explicit about the methods being proxied This primarily handles pollution of global Promise (either the type or the global object at runtime) by other libraries. Fixes: #3422 (comment)
- Update QueryInterface type to be explicit about the methods being proxied This primarily handles pollution of global Promise type by other libraries which can break Knex typings. Resolves: #3422 (comment)
This comment has been minimized.
This comment has been minimized.
Released in 0.20.1 |
Environment
Knex version: 0.19.3
Database + version: MySQL 5.7.22
OS: 10.14.6
If issue is about TypeScript definitions, tag @lorefnon.
Bug
Explain what kind of behaviour you are getting and how you think it should do
I'm using Typescript Version 3.5.1.🙃
When I upgrade knex version from 0.17.3 to 0.19.3, I got a compile error regarding timeout.
It worked well before.
Error message