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

Regression: @sentry/astro stopped re-exporting captureException in 8.8.0 #12410

Closed
3 tasks done
arty-name opened this issue Jun 7, 2024 · 5 comments · Fixed by #12453
Closed
3 tasks done

Regression: @sentry/astro stopped re-exporting captureException in 8.8.0 #12410

arty-name opened this issue Jun 7, 2024 · 5 comments · Fixed by #12453
Assignees
Labels
Package: astro Issues related to the Sentry Astro SDK Type: Bug

Comments

@arty-name
Copy link
Contributor

arty-name commented Jun 7, 2024

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/astro

SDK Version

8.8.0

Framework Version

4.10.0

Link to Sentry event

No response

SDK Setup

  integrations: [
    sentry({
      enabled: { client: false, server: true },
      tracePropagationTargets: [],
    }),
  ],

Steps to Reproduce

  1. Upgraded the SDK to the latest version to address Node SDK generating Error: ENOENT: no such file or directory #12059 and Astro integration follow the guide will get a error ENOENT: no such file or directory, open '/Users/xxx/astro-project/node_modules/@sentry/astro/esm/@sentry/node' #12192
  2. Tried accessing captureException in different ways:
import { captureException } from '@sentry/astro';
import * as Sentry from '@sentry/astro';
(await import('@sentry/astro')).captureException;

Expected Result

captureException should be available and usable, since the TypeScript types for the SDK mark it as present

Actual Result

Logging Sentry.captureException prints undefined, the property is absent from Sentry, seems not to be properly re-exported, while many other members of Sentry are present. I can access captureException when importing it directly from @sentry/node.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jun 7, 2024
@github-actions github-actions bot added the Package: astro Issues related to the Sentry Astro SDK label Jun 7, 2024
@Lms24
Copy link
Member

Lms24 commented Jun 10, 2024

Hey @arty-name to narrow this down - does this occur on the server or client side?

@arty-name
Copy link
Contributor Author

This was on the server side

@Lms24
Copy link
Member

Lms24 commented Jun 11, 2024

I could reproduce this locally, so I opened #12453 to fix it. Thanks for reporting! This is gonna be included in the release after 8.9.0.

@Lms24 Lms24 self-assigned this Jun 11, 2024
Lms24 added a commit that referenced this issue Jun 11, 2024
Fix a server-side re-export problem of `@sentry/node` exports
in the Astro SDK. It seems that the `export * from '@sentry/node'` "overruled" the
explicit exports. So this patch changes our export statements to:
- only export explicit, named exports in the JS server side entry point
- continue exporting all types via the `*` export in the types entry
point

fixes #12410
@Lms24
Copy link
Member

Lms24 commented Jun 11, 2024

This was released with version 8.9.1 - feel free to give it a try and let me know if the issue is fixed.

@arty-name
Copy link
Contributor Author

Thank you for the very quick processing of this issue! I confirm that it has been resolved 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: astro Issues related to the Sentry Astro SDK Type: Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants