V0.28 Type Issues
Hey i've been trying to use v0.28 branch, but whenever i install this branch from pnpm all the kysely types break, is there another way for me to use this branch. I tried locally cloning and building but seem to have the same type issues. Typescript just can't find kysely package at all.
23 Replies
Hey 👋
What TypeScript version are you using?
"typescript": "5.5.4", tried upgrading to latest too but that didnt seem to help
what typesript version does your ide currently point to?
it migth differ from the one installed in the project.
its using 5.5.4 too
does it export Kysely but as something else?
Im using "pnpm add https://github.com/kysely-org/kysely#v0.28" to add it,
ends up in package.json as "kysely": "github:kysely-org/kysely#v0.28",
no dist folder in kysely after install
i think this is to do with the tarball, i tried installing from the pull request as i've had success with that before but didn't help
Solution
npm i https://pkg.pr.new/kysely-org/kysely@1278
try this one instead
yeah that got it, noice! thanks for that
if you install straight from gh, you need to run the build script
it packs only things that are committed to the repo
yeah i went into the directory and run npm run build, but typescript still couldn't find it. But yeah makes sense
appreciate the quick response 🙂
np
would this create a circular reference? new version blows up my typescript completely
// Recursive CTE to get all parent tasks
.with("ParentHierarchy", (qb) =>
qb
.selectFrom("UserTasks")
.selectAll()
.unionAll(
qb
.selectFrom("tools.Task as t")
.innerJoin("ParentHierarchy as ph", "ph.ParentTaskId", "t.TaskId")
.selectAll("t"),
),
)
Previously this quey would just error, but it just hangs typescript completely now
Can you try this one without
selectAll
?thats better, it actually resolves now
ty
Can you share the example with
selectAll
that's crashing for you?
kyse.link preferably..https://kyse.link/Pw1kd
seems to be fine in the playground
yeah, well it doesn't have to compute all your codebase..
is still believe this can be useful to look at
i did some digging on my own because my typescript performance is really bad atm
i think its just the typescript error that i have with the self referencing cte, which is valid sql just not valid kysely/type syntax
i have the check expression selected at the bottom