-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Bun instrumentation stops working if reload
is called on the server
#15144
Comments
If `#reload` is called on an instance of `Bun.serve`, the Sentry intrumentation doesn't surive. This is because the Bun instrumentation works by using `Proxy` on the call to `Bun.serve`, which isn't called for a reload. We can't wrap the serve created by calling `Bun.serve` with a `Proxy` as Bun seems to do some internal checks using `instanceof` which break if the instance is now reporting itself as a `ProxyObject`. This fixes getsentry#15144.
Hey @nathankleyn thanks for reporting this! I see you're already working on a fix for this? I had a quick look at the commit and it looks good to me. Are you interested in opening a PR once it's ready? |
If `#reload` is called on an instance of `Bun.serve`, the Sentry intrumentation doesn't surive. This is because the Bun instrumentation works by using `Proxy` on the call to `Bun.serve`, which isn't called for a reload. We can't wrap the serve created by calling `Bun.serve` with a `Proxy` as Bun seems to do some internal checks using `instanceof` which break if the instance is now reporting itself as a `ProxyObject`. This fixes getsentry#15144.
Hey @Lms24 — thanks so much for your superfast reply! I've raised the PR now at #15148 (review), although I hit a bit of a problem when I discovered the tests for the I've reworked the tests a bit and raised a working version but I will definitely need a small amount of assistance to solve one last remaining problem with test isolation before it can be merged. Thanks in advance! |
If `#reload` is called on an instance of `Bun.serve`, the Sentry intrumentation doesn't surive. This is because the Bun instrumentation works by using `Proxy` on the call to `Bun.serve`, which isn't called for a reload. We can't wrap the serve created by calling `Bun.serve` with a `Proxy` as Bun seems to do some internal checks using `instanceof` which break if the instance is now reporting itself as a `ProxyObject`. This fixes getsentry#15144.
If `#reload` is called on an instance of `Bun.serve`, the Sentry intrumentation doesn't surive. This is because the Bun instrumentation works by using `Proxy` on the call to `Bun.serve`, which isn't called for a reload. We can't wrap the serve created by calling `Bun.serve` with a `Proxy` as Bun seems to do some internal checks using `instanceof` which break if the instance is now reporting itself as a `ProxyObject`. This fixes getsentry#15144.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/bun
SDK Version
8.51.0
Framework Version
Bun 1.1.45
Link to Sentry event
No response
Reproduction Example/SDK Setup
Steps to Reproduce
Reloading is done out of the box by some frameworks built on top of Bun Serve, like ElysiaJS (which does it after AOT / precompilation is completed).
Expected Result
The error should have instrumentation, such as request URL, request headers, browser information and trace information:
Actual Result
The error has no instrumentation at all:
The text was updated successfully, but these errors were encountered: