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

Unable to run "keystone prisma migrate dev" from Turborepo monorepo #8858

Closed
stuible opened this issue Oct 12, 2023 · 7 comments
Closed

Unable to run "keystone prisma migrate dev" from Turborepo monorepo #8858

stuible opened this issue Oct 12, 2023 · 7 comments
Labels
🐛 bug Unresolved bug

Comments

@stuible
Copy link

stuible commented Oct 12, 2023

How to reproduce the bug

1. I created this repo with Turbo Repo's starter project by running:

npx create-turbo -e basic

2. I then added Keystone CMS to ~/apps/keystone using

cd apps
npm init keystone-app@latest keystone

3. I then modified the keystone package.json to have migrate script:

"migrate": "NODE_ENV=development keystone prisma migrate dev"

4. Move to keystone directory and run keystone command

cd apps/keystone # move to keystone directory
npm run migrate # run our new migrate npm command

5. Receive the following output:

Error: Prisma Migrate has detected that the environment is non-interactive, which is not supported.

Expected Result

I expect the migrations to be created through an interactive terminal

Context

Repro Repo

https://github.com/stuible/keystone-interactive-cli-bug

Here is a MVP repo that reproduces the issue described above.

@borisno2 borisno2 added the 🐛 bug Unresolved bug label Oct 15, 2023
@austinbravodev
Copy link

I'm not using Turbo and the keystone prisma migrate dev command fails with the same error when run as an NPM script or via npx.

@flippinjoe
Copy link

This is actually a bug in turborepo. They swallow stdin (used for automatic migrations in keystone) vercel/turborepo#1235

@austinbravodev
Copy link

austinbravodev commented Oct 27, 2023

Could be both - I think the Keystone CLI creates a non-interactive context in which the Prisma command runs.

I'm just running it in my terminal, which should be interactive.

This would also explain why npx prisma migrate dev works.

@stuible
Copy link
Author

stuible commented Oct 29, 2023

This is actually a bug in turborepo. They swallow stdin (used for automatic migrations in keystone) vercel/turbo#1235

I have my doubts that this is a Turborepo issue because in the reproduction steps above I am bypassing the use of Turborepo completely (as far as I know).

@SagnikPradhan
Copy link

Weird, yarn keystone prisma migrate dev freezes but yarn dlx prisma@4.x migrate dev worked flawlessly

@stuible
Copy link
Author

stuible commented Oct 30, 2023

Weird, yarn keystone prisma migrate dev freezes but yarn dlx prisma@4.x migrate dev worked flawlessly

Exactly my experience as well (with the equivalent npx commands)

@dcousens
Copy link
Member

Fixed in #8898, will be published soon

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

6 participants