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

Circular-dependancy in latest build (7.101.1) #10726

Closed
3 tasks done
Marice opened this issue Feb 19, 2024 · 7 comments
Closed
3 tasks done

Circular-dependancy in latest build (7.101.1) #10726

Marice opened this issue Feb 19, 2024 · 7 comments
Labels
Package: browser Issues related to the Sentry Browser SDK Stale Type: Bug

Comments

@Marice
Copy link

Marice commented Feb 19, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

7.101.1

Framework Version

No response

Link to Sentry event

No response

SDK Setup

Using the circular-dependency-plugin (https://www.npmjs.com/package/circular-dependency-plugin)
I get warnings on circular dependacies in my webpack build:

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/utils/prepareEvent.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/utils/prepareEvent.js

This is my setup:

├─ @sentry-internal/feedback@7.101.1
│  ├─ @sentry/core@7.101.1
│  ├─ @sentry/types@7.101.1
│  └─ @sentry/utils@7.101.1
├─ @sentry-internal/replay-canvas@7.101.1
│  ├─ @sentry/core@7.101.1
│  ├─ @sentry/replay@7.101.1
│  ├─ @sentry/types@7.101.1
│  └─ @sentry/utils@7.101.1
├─ @sentry-internal/tracing@7.101.1
│  ├─ @sentry/core@7.101.1
│  ├─ @sentry/types@7.101.1
│  └─ @sentry/utils@7.101.1
├─ @sentry/browser@7.101.1
│  ├─ @sentry-internal/feedback@7.101.1
│  ├─ @sentry-internal/replay-canvas@7.101.1
│  ├─ @sentry-internal/tracing@7.101.1
│  ├─ @sentry/core@7.101.1
│  ├─ @sentry/replay@7.101.1
│  ├─ @sentry/types@7.101.1
│  └─ @sentry/utils@7.101.1
├─ @sentry/core@7.101.1
│  ├─ @sentry/types@7.101.1
│  └─ @sentry/utils@7.101.1
├─ @sentry/replay@7.101.1
│  ├─ @sentry-internal/tracing@7.101.1
│  ├─ @sentry/core@7.101.1
│  ├─ @sentry/types@7.101.1
│  └─ @sentry/utils@7.101.1
├─ @sentry/types@7.101.1
├─ @sentry/utils@7.101.1

Steps to Reproduce

Run the circular-dependancy tool with webpaclk, check the output.

This is the js code i use in my webpack.config.js:

new CircularDependencyPlugin({
        onDetected({ module: webpackModuleRecord, paths, compilation }) {
            compilation.warnings.push('Circular-dependency found: ' + new Error(paths.join(' -> ')))
        }
    })

Expected Result

No circular-dependancies detected

Actual Result

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js

WARNING in Circular-dependency found: Error: node_modules/@sentry/core/esm/utils/prepareEvent.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/utils/prepareEvent.js
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Feb 19, 2024
@github-actions github-actions bot added the Package: browser Issues related to the Sentry Browser SDK label Feb 19, 2024
@lforst
Copy link
Member

lforst commented Feb 20, 2024

Hi, thanks for writing in. We are aware of this but don't consider it harmful right now. Everything should work as expected. We will eventually fix this in the near future. Please ignore the warnings for now.

@Marice
Copy link
Author

Marice commented Feb 20, 2024

Hi, thanks for writing in. We are aware of this but don't consider it harmful right now. Everything should work as expected. We will eventually fix this in the near future. Please ignore the warnings for now.

Thank you for replying. I will ignore the warning, Thnx!

@AbhiPrasad
Copy link
Member

Might be a bigger blocker than we think.

#10698 is unable to be merged because the bundler plugins rely on old span API. When I try to upgrade the SDK in the bundler plugins (so that we can vendor it in as per getsentry/sentry-javascript-bundler-plugins#459) I can't build because of the circular dependency.

@lforst
Copy link
Member

lforst commented Feb 20, 2024

@AbhiPrasad that is a different kind of circular dependency than outlined in this issue. In your case it's an issue with our monorepo setup where we are using the local SDK in the repo for the E2E tests. Ideally we just remove the dependency from the bundler plugins.

@AbhiPrasad
Copy link
Member

Ideally we just remove the dependency from the bundler plugins.

yeah when I tried to do this rollup wouldn't build for the bundler plugins

✖  nx run @sentry/bundler-plugin-core:build
$ rimraf ./out && run-p build:rollup build:types
$ rollup --config rollup.config.js
$ tsc --project types.tsconfig.json
       
       src/index.ts → dist/esm/index.mjs, dist/cjs/index.js...
       [!] Error: Circular dependency: node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js
       Error: Circular dependency: node_modules/@sentry/core/esm/hub.js -> node_modules/@sentry/core/esm/scope.js -> node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js -> node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js -> node_modules/@sentry/core/esm/exports.js -> node_modules/@sentry/core/esm/hub.js

@lforst
Copy link
Member

lforst commented Feb 20, 2024

@AbhiPrasad It is just a warning we can ignore in the bundler plugin repo. I configured rollup there to throw on warnings because usually we would like to avoid all warnings. We can turn that off for the time being.

@getsantry
Copy link

getsantry bot commented Mar 22, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Mar 22, 2024
@getsantry getsantry bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: browser Issues related to the Sentry Browser SDK Stale Type: Bug
Projects
Archived in project
Development

No branches or pull requests

4 participants