keystonejs / keystone

The superpowered headless CMS for Node.js — built with GraphQL and React
https://keystonejs.com
MIT License
9.22k stars 1.16k forks source link

Keystone cli installs conflicting versions of prisma dependencies #9349

Open WoodyWoodsta opened 1 week ago

WoodyWoodsta commented 1 week ago

Out of the box, keystone dev installs @prisma/client and prisma dependencies in such a way that version conflicts arise.

  1. Perform "install" walkthrough
  2. Run keystone dev

You'll see an error message which indicates a version mismatch of prisma dependencies:

Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.

Expected: Keystone works out of the box. Keystone CLI should install the packages locally with the same version specifier as its internal package.json.

Additional Info

$ pnpm why @prisma/client

dependencies:
@keystone-6/core 6.3.0
└── @prisma/client 5.19.0
@prisma/client 5.20.0
gautamsi commented 1 week ago

keystone has specific prisma version resolution, if you want to use higher version you want to add that to resolutions or overrides in your package.json

WoodyWoodsta commented 1 week ago

@gautamsi That is understood. However, the issue is that the keystone cli installs a version which does not match the specific version you mention.

crewshin commented 1 week ago

Ah... is this is why I'm having issues with a default/new install?

Literally you run:

pnpm create keystone-app@latest
cd my-app
pnpm run dev

and it errors out with:

Error: Schema engine exited. Error: Command failed with exit code 1: /Users/mee/src/tests/static/backend/node_modules/.pnpm/@prisma+engines@5.19.0/node_modules/@prisma/engines/schema-engine-darwin-arm64 cli --datasource <REDACTED> can-connect-to-database