Running multiple build-storybook targets in parallel results in ngcc conflict error.
See original GitHub issueCurrent Behavior
Running multiple build-storybook targets in parallel (i.e. in affected or run-many use case) will result in an ngcc conflict error ngcc is already running at process with id [process id]. This is especially problematic running component tests with cypress using storybook in parallel as this will also result in the same error because this uses the build-storybook target.
Commands that will cause the error:
npx nx run-many --target=build-storybook --projects=[project1,project2] --parallel
npx nx run-many --target=e2e --all --parallel.
Expected Behavior
Running multiple build-storybook targets should not result in an ngcc lock error.
Steps to Reproduce
- Create a new Angular workspace
- Run npm
- Create 2 libs with 2 storybook configurations
- Run
npx nx run-many --target=build-storybook --projects=[project1,project2] --parallel
An ngcc error should appear, presumably because they are both using the same app which will trigger a short lock.
Repo where error is reproduced after executing the above steps: https://github.com/LuukMoret/test-org
Run command npm install and then run command npx nx run-many --target=build-storybook --projects=test,test2 --parallel or run npx nx run-many --target=e2e --all --parallel
Environment
Node : 14.17.5 OS : darwin x64 npm : 6.14.14
nx : Not Found @nrwl/angular : 12.7.2 @nrwl/cli : 12.7.2 @nrwl/cypress : 12.7.2 @nrwl/devkit : 12.7.2 @nrwl/eslint-plugin-nx : 12.7.2 @nrwl/express : Not Found @nrwl/jest : 12.7.2 @nrwl/linter : 12.7.2 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/nx-cloud : Not Found @nrwl/react : Not Found @nrwl/schematics : Not Found @nrwl/tao : 12.7.2 @nrwl/web : Not Found @nrwl/workspace : 12.7.2 @nrwl/storybook : 12.7.2 @nrwl/gatsby : Not Found typescript : 4.3.5
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:9 (3 by maintainers)

Top Related StackOverflow Question
We are experiencing the same issue when running parallel E2E tests on Storybook. It seems the builder “@nrwl/cypress:cypress” (v12.5.8) does not support NGCC-lock-waiting.
Found another solution for this, but hacky:
ngcc --create-ivy-entry-points --first-only