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

CLI build and prisma migrate commands never exit #8581

Closed
kam237zasada opened this issue May 18, 2023 · 7 comments · Fixed by #8788
Closed

CLI build and prisma migrate commands never exit #8581

kam237zasada opened this issue May 18, 2023 · 7 comments · Fixed by #8788

Comments

@kam237zasada
Copy link

Just create new Keystone app with yarn create-keystone-app then try to execute command yarn build -> 'keystone build'

The expected behaviour is to build production ready output in .keystone/admin and exit process when this will be successfully done. But now the process is never exited even when build is done successful which is very inconvenient because basically there is no chance to go to another command when we want to deploy application - build hang out forever without exit after success.

Screenshot 2023-05-18 at 08 17 29

node version 16.19.1 but I also tried with newest LTS 18
next version - I tried with 13.2.2, 13.2.3, 13.3, 13.4.2

But I believe that this is no related to other similar issues with hang out build command with: info - Creating an optimized production build ... because I saw that this is related to some next versions above 13.2.3 and I also had that issue but figured it out changing next version, so the message disappeared after build but still build process is not exited.

When I simply added process.exit() in keystone-6-core-scripts-cli.cjs.prod.js at the end of function build which is responsible for that, everything went as expected.

Also there is the same issue with keystone prisma migrate CLI commands.

@velimd
Copy link

velimd commented Jun 13, 2023

Hi, did you find a fix or any more info for this issue?

@kam237zasada
Copy link
Author

@velimd Hi, the simplest workaround which I found is to create some build.js file in root directory, export build script from keystone and just add process.exit() after it will be executed, something like this:

const scripts = require("@keystone-6/core/scripts/cli");

(async () => {
  await scripts.cli(__dirname, ["build"]);
  process.exit();
})();

Then instead of using built-in keystone build I added custom simple script to package.json to execute build.js ->

"scripts": {
...
 "build": "cross-env NODE_ENV=production node build.js"
 }

@Arithmetics
Copy link

also seeing this

@nedgar
Copy link

nedgar commented Aug 8, 2023

Same. Thanks for the workaround. I'm running node v18.16.1 on Mac.

@cyanonoob
Copy link

also seeing this, workaround worked. seems related to #8760

@ARkrOSClou
Copy link

  "overrides": { "next": "13.4.12" },
  "resolutions": { "next": "13.4.12" }

overrides for npm
resolutions for yarn
or both

@dcousens
Copy link
Member

Maybe related to vercel/next.js#54494

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

Successfully merging a pull request may close this issue.

7 participants