Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search Through PNPM Monorepo Packages For Circular Depndencies #428

Open
bestickley opened this issue Jun 15, 2024 · 1 comment
Open

Search Through PNPM Monorepo Packages For Circular Depndencies #428

bestickley opened this issue Jun 15, 2024 · 1 comment

Comments

@bestickley
Copy link

Hello, first thank you for such a great library!

When I run next build I get this error:

pnpm build

> template-app-ui@0.1.0 build /Users/stickb/Code/dos/dos-monorepo/packages/template/app/ui
> next build

  ▲ Next.js 14.3.0-canary.37

   Creating an optimized production build ...
Failed to compile.

../core/src/config/config.server.ts + 10 modules
Cannot get final name for export 'commonEnvVarNames' of ../../../shared/lib/core/src/index.test.ts


> Build failed because of webpack errors

Which I believe to be a circular dependency error. So I tried running madge at the root of my PNPM Monorepo and I get this:

pnpx madge --warning --circular --extensions ts,tsx --exclude cdk-nextjs --include-npm packages
⠋ Finding files=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0

YOUR TYPESCRIPT VERSION: 5.4.5

Please only submit bug reports when using the officially supported version.

=============
Processed 205 files (1.7s) (13 warnings)

✔ Image created at /Users/stickb/Code/dos/dos-monorepo/deps.png

✖ Skipped 13 files

shared-lib-ui
@/config/config.shared
notification-lib-ui
template-app-core/server
template-app-core/shared
shared-lib-core/edge
shared-lib-core/shared
shared-lib-core/test
shared-lib-infra
shared-lib-core/node
assistant-lib-ui
template-svc-core/shared
template-app-core/node

It looks like madge isn't resolving my internal packages. How can I get madge to dive into them? I tried --include-npm but that did not work :(

Appreciate any help!

@bitofbreeze
Copy link

If you're using tsconfig paths, you need to provide madge a path to your tsconfig file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants