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

Commit

Permalink
fix(dependency-analysis): handle case where dependencies field is und…
Browse files Browse the repository at this point in the history
…efined (#802)

Handle case where dependencies field on an unlocked package is undefined, which
was causing an error when attempting to reference a method 'find' on
dependencies.
  • Loading branch information
aly76 authored Jan 10, 2022
1 parent 5a69c21 commit f66b7a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/dependency/DependencyAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class DependencyAnalysis {
cmp.packageType === "Unlocked" &&
component.package !== cmp.package
) {
const isDependencyDefined = projectConfig.packageDirectories[component.indexOfPackage].dependencies.find(dependency => {
const isDependencyDefined = projectConfig.packageDirectories[component.indexOfPackage].dependencies?.find(dependency => {
const packageName: string = dependency.package.split("@")[0];
return packageName === cmp.package;
}) ? true : false
Expand Down

0 comments on commit f66b7a2

Please sign in to comment.