Issue: failure to run with combinedDependencies: true on a monorepo

Author: asfaltboyCreated Jul 13, 2024Updated Sep 1, 2024
Labelsbug

Expected Behavior

I'm using yarn workspaces, and I expect it to work out of the box

Current Behavior

whenever I turn on the combinedDependencies: true option, I get an error

ERROR: Extracting dependencies ran afoul of...

pWorkspace.endsWith is not a function
... in e2e/playwright.config.ts

Without the option it runs ok, but reports packages as missing, where they are specified at the top level workspace package.json file

Possible Solution

I would love to see a more descriptive error, and ideally it would just work...

Steps to Reproduce (for bugs)

  1. Create a yarn workspaces project
  2. Add number of packages in different locations
  3. Run depcruise --init wizard, choose the defaults
  4. Set the option combinedDependencies: true
  5. Run depcruise .

Context

Just trying dependency-cruiser out, as an alternative to circular dependency lint rule of eslint-plugin-import (see rule definition of import/no-cycle)

I would also accept a workaround that disables the missing dependency check, if circular deps can be checked independently.

Your Environment

  • Version used: 16.3.6
  • Node version: 20.9
  • Operating System and version: macOS Sonoma 14.5 (23F79)
  • Link to your project: private

Source: sverweij/dependency-cruiser