Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Sanity Codegen process hangs on completion #243

@alexbchr

Description

@alexbchr

We are currently starting a new project and realized that for some reason, running  sanity-codegen on the project using Node 16.13.2 (or 15.14.0) just hangs. This seems to be a very similar issue to #232.

What I did try locally to fix this is adding a then clause that explicitly exits the process at the end of the CLI process fixes the issue.

In cli.ts file, replacing:

cli().catch((e) => {
  console.error(e);
  process.exit(1);
});

With:

cli().then(() => process.exit(0)).catch((e) => {
  console.error(e);
  process.exit(1);
});

Fixed the hanging issue. Since the last line of cli() gets correctly printed on the culprit computer, the Promise ends fine and everything, but for some unknown reason the process just remains alive. Seems like something in the code is being kept alive that prevents Node from ending the process properly when its work is done. I have no idea what this would be though.

I was able to reproduce on many different computers this time, and even running sanity-codegen inside Github Actions hangs by using the same Node version.

Running sanity-codegen on Node 12 and 14 works fine without any issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions