RobinBlomberg / kysely-codegen

Generate Kysely type definitions from your database.
MIT License
806 stars 73 forks source link

@libsql/kysely-libsql peer dependency #110

Open michael-golden opened 1 year ago

michael-golden commented 1 year ago

Hi - I'd like to contribute to this repo - however, I'm unsure how to install the peer dependencies appropriately.

Cloning the repo from master, running pnpm install, then running pnpm run build yields a TSC error:

src/dialects/libsql/libsql-dialect.ts:10:44 - error TS2307: Cannot find module '@libsql/kysely-libsql' or its corresponding type >declarations.

10 const { LibsqlDialect } = await import('@libsql/kysely-libsql');

Is there a contributor file I've overlooked? Can you advise on how to get the repo bulding/running locally?

Upvote & Fund

Fund with Polar

rhh4x0r commented 10 months ago

Getting the same error here.

RobinBlomberg commented 8 months ago

Is this still a problem? It appears to work for me (on the new 0.13.0 version at least).

RobinBlomberg commented 8 months ago

Closing this as I cannot replicate and am unsure if it's still a problem. I'll reopen if someone still has problems.

lendle commented 1 month ago

I'm having the same problem. Things were working, but with no related changes AFAIK, building my project with tsc started throwing this error. I'm sure it's due to some change on my end, but I have no idea what. I'm not using libsql. I was able to install it as a dev dependency and that got things working again.

dpgalloway commented 3 weeks ago

Did anyone figure this out? I'm having the same error

dpgalloway commented 3 weeks ago

Update: There is a typo in the docs that has dire consequences:

https://github.com/RobinBlomberg/kysely-codegen/blob/40e3f119bb2b778f8b3fb13d3633975d6f9a03ca/README.md?plain=1#L133

This line should instead be import { DB } from '@/types/db', or wherever you save your .d.ts file generated by kysely-codegen.

This fixes the libsql error as well as several other errors I was starting to see.