-
-
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
@simplewebauthn/server is not supported when using ESM #12996
Comments
Hey, can you try to exclude this package from instrumentation - I just noticed this was not properly documented yet, so I added docs here getsentry/sentry-docs#10803 So something like this: Sentry.init({
registerEsmLoaderHooks: {
// Provide a list of package names to exclude from instrumentation
exclude: ["@simplewebauthn/server"],
},
}); |
You might need to use a regular expression: Sentry.init({
registerEsmLoaderHooks: {
// Provide a list of package names to exclude from instrumentation
exclude: [/@simplewebauthn\/server/],
},
}); For regular expressions to work you'll need to ensure that The Sentry type definitions don't yet allow regular expressions so I've opened a PR for that. |
Thank you for your help. After upgrading registerEsmLoaderHooks: {
// @ts-expect-error -- https://github.com/getsentry/sentry-javascript/pull/13016
exclude: [/@simplewebauthn\/server/],
}, It was indeed required to use regular expressions. Using |
Thank you for confirming! We should hopefully have an update coming soon which will negate the need for this manual configuration. |
v8.29.0 of the Node SDK adds the new import * as Sentry from '@sentry/node';
Sentry.init({
dsn: '__PUBLIC_DSN__',
registerEsmLoaderHooks: { onlyIncludeInstrumentedModules: true },
}); When set to This feature will only work if you Please let me know if this helps solve the |
Closing this for clean-up. If this issue still applies, please re-open. Thanks! |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.19.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup/Reproduction Example
Steps to Reproduce
Install
@simplewebauthn/server
version 10.0.0.Expected Result
Using
@simplewebauthn/server
using Sentry intstrumentation in an ESM environment should work.Everything works fine when removing the
--import ./instrument.js
flag.Actual Result
The text was updated successfully, but these errors were encountered: