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

Fix: support Bun runtime in the core library #127

Merged
merged 7 commits into from
Sep 25, 2023
Merged

Conversation

keturiosakys
Copy link
Member

@keturiosakys keturiosakys commented Sep 15, 2023

This update addresses #112 issue that made the library unusable in the Bun runtime.

Unlike Node/Deno (built on V8), Bun runtime (built on JSC) does not expose the Error stack trace modification features that we tap into to more reliably find the module for the autometrics-wrapped function. This update adds defensive code to check for it and if the prepareStackTrace doesn't exist, it will resort to an earlier version of manual stack trace parsing to find the module for the function.

It also updates the test for utilities to ensure it can consistenly run with our main test engine vitest and updates the script to run the test in bun as well.

Bun runtime (built on JSC) does not expose the Error stack trace modification features that we tap into V8. This update adds defensive code to check for it and if the "prepareStackTrace" doesn't exist, it will resort to an earlier version of manual stack trace parsing to find the module for the function
…situation and ensure the module is reported consistently
@keturiosakys keturiosakys marked this pull request as ready for review September 21, 2023 11:54
@keturiosakys keturiosakys linked an issue Sep 21, 2023 that may be closed by this pull request
@keturiosakys keturiosakys merged commit e9cf34b into main Sep 25, 2023
1 check passed
@keturiosakys keturiosakys deleted the bun-runtime branch September 25, 2023 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError when using Hono framework
2 participants