fix(core): don't fail on skipped optional deps, when calculating depsRequiringBuild (#8404)

This commit is contained in:
Zoltan Kochan
2024-08-11 14:54:27 +02:00
committed by GitHub
parent 9b4f73caaf
commit 39f693ba89
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/core": patch
---
Don't fail on skipped optional dependencies, when searching for dependencies that should be built.

View File

@@ -1420,7 +1420,7 @@ const _installInContext: InstallFunction = async (projects, ctx, opts) => {
const depsRequiringBuild: DepPath[] = []
if (opts.returnListOfDepsRequiringBuild) {
await Promise.all(Object.entries(dependenciesGraph).map(async ([depPath, node]) => {
if (node == null) return // We cannot detect if a skipped optional dependency requires build
if (node?.fetching == null) return // We cannot detect if a skipped optional dependency requires build
const { files } = await node.fetching()
if (files.requiresBuild) {
depsRequiringBuild.push(depPath as DepPath)