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

[@sentry/remix] init method is typed to return void, but actually returns the client #13932

Closed
3 tasks done
haines opened this issue Oct 10, 2024 · 2 comments · Fixed by #13938
Closed
3 tasks done

[@sentry/remix] init method is typed to return void, but actually returns the client #13932

haines opened this issue Oct 10, 2024 · 2 comments · Fixed by #13938
Labels
Package: remix Issues related to the Sentry Remix SDK

Comments

@haines
Copy link

haines commented Oct 10, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/remix

SDK Version

8.33.1

Framework Version

2.12.1

Link to Sentry event

No response

Reproduction Example/SDK Setup

export function init(options: RemixOptions): Client | undefined {

export function init(options: RemixOptions): NodeClient | undefined {

export declare function init(options: RemixOptions): void;

Steps to Reproduce

I want to use our existing OpenTelemetry setup with Remix.

The guide says to import init from @sentry/node, but that won't set up the Sentry Remix SDK, will it?

But if I input init from @sentry/remix, it's typed to return void even though it actually returns a Sentry client.

Expected Result

I can use an existing OpenTelemetry setup with Remix without getting TypeScript compilation errors.

Actual Result

The types are wrong

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Oct 10, 2024
@github-actions github-actions bot added the Package: remix Issues related to the Sentry Remix SDK label Oct 10, 2024
@mydea
Copy link
Member

mydea commented Oct 10, 2024

Hey, thanks for raising this, you are right, this is incorrect - I will update this!

mydea added a commit that referenced this issue Oct 11, 2024
Fixes #13932

We have defined the type for the shared client/server types in
meta-frameworks incorrectly, `init` now returns `Client | undefined` and
not `void` anymore.
Copy link
Contributor

A PR closing this issue has just been released 🚀

This issue was referenced by PR #13938, which was included in the 8.35.0-beta.0 release.

mydea added a commit that referenced this issue Oct 17, 2024
Noticed here:
#13932 (comment)
we should not add comments for prereleases 😅
billyvg pushed a commit that referenced this issue Oct 17, 2024
Fixes #13932

We have defined the type for the shared client/server types in
meta-frameworks incorrectly, `init` now returns `Client | undefined` and
not `void` anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: remix Issues related to the Sentry Remix SDK
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants