Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Circular dependency #87

Closed
jonathanblancor opened this issue Jun 2, 2021 · 5 comments · Fixed by #96 or #119
Closed

Circular dependency #87

jonathanblancor opened this issue Jun 2, 2021 · 5 comments · Fixed by #96 or #119

Comments

@jonathanblancor
Copy link

jonathanblancor commented Jun 2, 2021

I am using this library through @azure/identity and is throwing a Circular dependency warning. I have placed the text warning and picture.

I am importing @azure libraries as:
import * as azureIdentity from '@azure/identity';
import * as appConfig from '@azure/app-configuration';

Warning:
Circular dependency: node_modules\@azure\identity\node_modules\@opentelemetry\api\build\src\index.js -> node_modules\@azure\inode_modules\@opentelemetry\api\build\src\internal\global-utils.js -> node_modules\@azure\identity\node_modules\@opentelemetr Circular dependency: node_modules\@azure\identity\node_modules\@opentelemetry\api\build\src\index.js -> node_modules\@azure\inode_modules\@opentelemetry\api\build\src\internal\global-utils.js -> C:\Users\JBlanco\Documents\MFE - Product\node_modules\\@azure\identity\node_modules\@opentelemetry\api\build\src\index.js Circular dependency: node_modules\@azure\core-http\node_modules\@opentelemetry\api\build\src\index.js -> node_modules\@azure\tp\node_modules\@opentelemetry\api\build\src\internal\global-utils.js -> node_modules\@azure\core-http\node_modules\@opentele Circular dependency: node_modules\@azure\core-http\node_modules\@opentelemetry\api\build\src\index.js -> node_modules\@azure\tp\node_modules\@opentelemetry\api\build\src\internal\global-utils.js -> C:\Users\JBlanco\Documents\MFE - Product\node_modulules\@azure\core-http\node_modules\@opentelemetry\api\build\src\index.js

image

Any other information needed please let me know.

@vreynolds
Copy link

Sounds like an issue with @azure/identity, since opentelemetry-js-api doesn't depend on azure. Could you raise it in the azure repo?

@dyladan
Copy link
Member

dyladan commented Jun 7, 2021

@opentelemetry/api actually has no circular dependencies. It sounds like most likely @azure/identity is depending on an internal module of @opentelemetry/api or even patching it which causes the dependency circle.

@sadasant
Copy link

sadasant commented Jun 14, 2021

Hello! I’m from the Azure SDK team.

I’m trying to figure out what’s going on. It seems to me that there is a circular dependency indeed.

For context, we’ve been using version 0.10.2 of @opentelemetry/api, could there have been a circular dependency in that version? On 0.10.2 we see the following: src/index.ts depends on src/api/context.ts, which depends on src/internal/global-utils.ts, which depends on src/index.ts. I don’t see the internal folder you’re referring to there. cc: @dyladan

We’re working on upgrading to version 0.20.0: Azure/azure-sdk-for-js#15672 - based on the folder structure, I believe it may help, but I haven’t been able to confirm (we will in the following days).

@dyladan
Copy link
Member

dyladan commented Jun 16, 2021

Seems you're right. global-utils.ts depends on the diag API.

@maorleger
Copy link

maorleger commented Jul 12, 2021

I updated to @opentelemetry/api@1.0.1 which contains the fix for that dependency cycle; however, I see another circular dependency that is unresolved:

I believe this is the problem: src/index.ts depends on src/baggage/utils.ts which depends on src/index.ts

Rollup errors:

Error: Circular dependency: ../../../common/temp/node_modules/.pnpm/@opentelemetry/api@1.0.1/node_modules/@opentelemetry/api/build/esm/index.js -> ../../../common/temp/node_modules/.pnpm/@opentelemetry/api@1.0.1/node_modules/@opentelemetry/api/build/esm/baggage/utils.js -> ../../../common/temp/node_modules/.pnpm/@opentelemetry/api@1.0.1/node_modules/@opentelemetry/api/build/esm/index.js

Let me know if you'd rather me open a new issue or if you need any more information!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants