Skip to content

Commit

Permalink
fix(core): fix postinstall failure due to project graph build error (#…
Browse files Browse the repository at this point in the history
…9960)

Delegate error handling to calling functions and avoid `process.exit(1)`, which causes the package's postinstall stage to fail if there are problems with the project graph

Closes #9451
  • Loading branch information
tommazzo89 committed Apr 25, 2022
1 parent f7efef4 commit 2647e48
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/nx/src/project-graph/project-graph.ts
Expand Up @@ -54,13 +54,8 @@ export function readCachedProjectGraph(): ProjectGraph {
}

async function buildProjectGraphWithoutDaemon() {
try {
await defaultFileHasher.ensureInitialized();
return await buildProjectGraph();
} catch (e) {
printErrorMessage(e);
process.exit(1);
}
await defaultFileHasher.ensureInitialized();
return await buildProjectGraph();
}

/**
Expand Down

1 comment on commit 2647e48

@vercel
Copy link

@vercel vercel bot commented on 2647e48 Apr 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx.dev
nx-five.vercel.app

Please sign in to comment.