Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kysely version must be updated #1476

Open
vanya2h opened this issue Jan 31, 2025 · 2 comments
Open

kysely version must be updated #1476

vanya2h opened this issue Jan 31, 2025 · 2 comments

Comments

@vanya2h
Copy link

vanya2h commented Jan 31, 2025

Version

0.9.1

Current behavior

Hi! I'm facing the issue with package peer dependency resolution:

"kysely": "^0.26.3",

which is different from what is needed in order to match the peer dependency of [email protected]

here's warn from pnpm install about this:

packages/indexer
└─┬ ponder 0.9.1
  └─┬ kysely-pglite 0.6.1
    └─┬ kysely-codegen 0.15.0
      └── ✕ unmet peer kysely@^0.27.0: found 0.26.3 in ponder

I found this bug because my pnpm lock file was relying on two different versions of kysele:

  • 0.27.5 (it was installed by me at some point so it was referenced in lock file)
  • 0.26.3 (by ponder)

And it was leading to wrong type resolutions for the new SQL client:

createPonderClient(baseUrl, { schema }).db.select().from(schemas.pools)
Type 
'import("/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/drizzle-orm/pg-core/columns/common").PgColumn<...>' 
is not assignable to type 
'import("/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/drizzle-orm/pg-core/columns/common").PgColumn<...>

In the path of type resolutions you can see there's different versions of kysely being resoled that leads to a problem.

Temp solution:

  • Add resolutions field in package.json of your root package.json with "kysely": "^0.27.5"

Expected behavior

No response

Steps to reproduce

No response

Link to repository

No response

Anything else?

No response

@typedarray
Copy link
Collaborator

Thanks for reporting. I'm a bit confused why [email protected] was installed instead of [email protected] (or whatever the pre-existing installed version of kysely was) because the ponder package.json specifies "kysely": "^0.26.3". The updated minor should be acceptable.

I'm finding this tricky to reproduce and debug, so lmk if you have any suggestions for 1) a minimal reproduction or 2) how we can fix it on our end.

I don't think this will solve the 2nd issue (client type resolution), but I just opened a PR to remove the kysely-pglite dep which will eliminate the 1st issue (pnpm install warning).

@vanya2h
Copy link
Author

vanya2h commented Feb 1, 2025

Hi @typedarray! thank you for very quick support on this.

Here's steps to produce:

  1. npm init -y
  2. pnpm add [email protected]
  3. (see warning)
  4. pnpm add kysely@^0.27.0 (trying to fix warning)
  5. (see no warning but it leads to problems with new SQL client integration)

To fix this I think it's better not to list kysely as a dependency but as peerDependency or no dependency at all because it still will be requested by drizzle-orm (as a transient dependency). And to prevent problems while development list it as devDependency in your package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants