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

Keystone cli installs conflicting versions of prisma dependencies #9349

Open
WoodyWoodsta opened this issue Oct 6, 2024 · 6 comments
Open
Labels
🐛 bug Unresolved bug

Comments

@WoodyWoodsta
Copy link

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
Copy link
Member

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
Copy link
Author

@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
Copy link

crewshin commented Oct 12, 2024

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/@[email protected]/node_modules/@prisma/engines/schema-engine-darwin-arm64 cli --datasource <REDACTED> can-connect-to-database

@dwidge
Copy link
Contributor

dwidge commented Dec 19, 2024

Workaround:
Check version: $ pnpm why @prisma/client.
Change version of prisma in 2 places in package.json to match version given above.

{
  "name": "keystone-app",
  "version": "1.0.3",
  "private": true,
  "scripts": {
    "dev": "keystone dev",
    "start": "keystone start",
    "build": "keystone build"
  },
  "dependencies": {
    "@keystone-6/auth": "^8.0.0",
    "@keystone-6/core": "^6.0.0",
    "@keystone-6/fields-document": "^9.0.0",
    "@prisma/client": "^5.22.0",
    "typescript": "^5.5.0"
  },
  "devDependencies": {
    "prisma": "^5.22.0"
  }
}

@dcousens dcousens added the 🐛 bug Unresolved bug label Dec 19, 2024
@dcousens
Copy link
Member

@WoodyWoodsta how do you reproduce this problem?

@WoodyWoodsta
Copy link
Author

@dcousens Repro is in the description:

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

I have not worked with this for quite some time so I'm not if it is still an issue.

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

No branches or pull requests

5 participants