Closed thekiwi closed 3 months ago
Ok, I've figured it out - it's not a bug, I just needed to install @types/node
as a dev dependency. A super easy solution, but I think it could be useful to mention in the Kysely/MySQL docs?
At least now if anyone comes across the same error, there's a GitHub issue they can search :)
You pretty much ALWAYS need @types/node
with node and typescript. It's not something we should need to teach people. That's like mentioning people need a package.json
file.
I'm attempting to use the latest Kysely (
0.27.4
) with the latest MySQL2 (3.10.3
) and I'm getting a type mismatch when assigningcreatePool()
to thepool
property.Here is my simple code (copied from here):
And here is the Typescript error:
I tried older
mysql2
versions and found it worked at3.4.0
but then started throwing the error at3.4.1
. The changes between the two were made over a year ago, which makes me wonder why no-one else has encountered this yet, hence me creating this issue to check if I've misconfigured something.I'll continue to dig and report back what I find, but I'm curious whether anyone has stumbled across this and solved it? And if so, perhaps we can get the docs updated?