You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Circular dependency when building with sentry sveltekit #11553
Hey @sajaghori thanks for writing in! Yes, sadly there's a small circle in our import chain in the core package. We're resolving this in our new major version of the SDK (v8).
Does this block you at the moment? Are you by chance using a strict tsconfig of some kind (skiplibcheck 👀 ) that surfaces this issue? We'll fix this but just wondering if you can work around it in the meantime.
Hi @Lms24 thanks for the response! skiplibcheck does not work.
I was looking for the reason why my vite dev server hangs sometimes. I can tell you that this circular dependency is not the root of cause. So feel free to close this or leave it open until you have v8 released.
Thanks for the update! The important thing is that you're not blocked by our SDK :)
I'll leave this open for now until the circular dependency is resolved.
Hi @sajaghori, we fixed the circular dependency in the core package in #12159. When you update to the latest v8 version of the SDK would you mind letting us know if this issue is fixed?
Hi @Lms24 yes, it works now with the latest version.
However, keep in mind that the import line needed to be changed from import * as Sentry from '@sentry/sveltekit' to import Sentry from '@sentry/sveltekit'
I think you need to adjust the setup wizard on your side, otherwise the integrations won't work.
Thank you! Closing this issue.
This is unexpected. The SDK should work with the namespace import, not the default import. That's how our SvelteKit E2E tests are set up (example). Does your setup look different from this? Also, does this apply to both, client and server side?
Ahh I see, this is because we don't explicitly re-export httpIntegration from @sentry/sveltekit. I wonder why our export consistency check didn't catch this 😬
May I ask why you want to initialize the integration manually? If you set debug: true, you should get a list of all integrations that are installed at SDK intialization. Http should be in this list by default.
Regardless, the problem though is that I'm afraid, httpIntegration won't do much for SvelteKit because the hooks.server.js file is evaluated too late for opentelemetry instrumentation. This is sort of an open problem that affects multiple instrumentations. Haven't had much time to look into this yet but we definitely should soon.
Activity
Lms24 commentedon Apr 11, 2024
Hey @sajaghori thanks for writing in! Yes, sadly there's a small circle in our import chain in the core package. We're resolving this in our new major version of the SDK (v8).
Does this block you at the moment? Are you by chance using a strict tsconfig of some kind (
skiplibcheck👀 ) that surfaces this issue? We'll fix this but just wondering if you can work around it in the meantime.sajaghori commentedon Apr 16, 2024
Hi @Lms24 thanks for the response!
skiplibcheckdoes not work.I was looking for the reason why my
vitedev server hangs sometimes. I can tell you that this circular dependency is not the root of cause. So feel free to close this or leave it open until you have v8 released.Lms24 commentedon Apr 16, 2024
Thanks for the update! The important thing is that you're not blocked by our SDK :)
I'll leave this open for now until the circular dependency is resolved.
Lms24 commentedon Jun 4, 2024
Hi @sajaghori, we fixed the circular dependency in the core package in #12159. When you update to the latest v8 version of the SDK would you mind letting us know if this issue is fixed?
sajaghori commentedon Jun 4, 2024
Hi @Lms24 yes, it works now with the latest version.
However, keep in mind that the import line needed to be changed from
import * as Sentry from '@sentry/sveltekit'toimport Sentry from '@sentry/sveltekit'I think you need to adjust the setup wizard on your side, otherwise the integrations won't work.
Thank you! Closing this issue.
Lms24 commentedon Jun 4, 2024
This is unexpected. The SDK should work with the namespace import, not the default import. That's how our SvelteKit E2E tests are set up (example). Does your setup look different from this? Also, does this apply to both, client and server side?
sajaghori commentedon Jun 4, 2024
Exactly like your example in hooks.server.ts, but add this line in the init property
integrations: [Sentry.httpIntegration()]sajaghori commentedon Jun 4, 2024
No just server side with hooks.server.ts
sajaghori commentedon Jun 4, 2024
You should get the error:
TypeError: Sentry.httpIntegration is not a functionwith version:
"@sentry/sveltekit": "^8.7.0",with hooks.server.ts:
Lms24 commentedon Jun 4, 2024
Ahh I see, this is because we don't explicitly re-export
httpIntegrationfrom@sentry/sveltekit. I wonder why our export consistency check didn't catch this 😬May I ask why you want to initialize the integration manually? If you set
debug: true, you should get a list of all integrations that are installed at SDK intialization.Httpshould be in this list by default.Regardless, the problem though is that I'm afraid,
httpIntegrationwon't do much for SvelteKit because thehooks.server.jsfile is evaluated too late for opentelemetry instrumentation. This is sort of an open problem that affects multiple instrumentations. Haven't had much time to look into this yet but we definitely should soon.sajaghori commentedon Jun 4, 2024
Alright thank you for the insights. Would love to hear about improvements in the sveltekit sdk.