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
// Preloaded using node --import flag. Do not import code from other source files here.// https://docs.sentry.io/platforms/javascript/guides/node/install/esm/// @ts-checkimport{dirname}from'node:path'import{fileURLToPath}from'node:url'import*asSentryfrom'@sentry/node'import{nodeProfilingIntegration}from'@sentry/profiling-node'/** * The root directory of the application. * @see {@link https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/rewriteframes/} */constroot=dirname(fileURLToPath(import.meta.url))constenv=process.env['SENTRY_ENV']||process.env['NODE_ENV']||'development'constversion=process.env['PACKAGE_VERSION']Sentry.init({dsn: 'redacted',release: version ? `api@${version}` : undefined,environment: env,integrations: [nodeProfilingIntegration(),Sentry.dedupeIntegration(),Sentry.rewriteFramesIntegration({ root }),Sentry.prismaIntegration(),],beforeBreadcrumb: (breadcrumb)=>{// Filter out writes to apollographql reporting API, because they are not helpful for error tracing// and spam breadcrumbs.if(breadcrumb.type==='http'&&typeofbreadcrumb.data?.['url']==='string'&&breadcrumb.data['url'].includes('api.apollographql.com')){returnnull}returnbreadcrumb},tracesSampleRate: 0.1,profilesSampleRate: 0.1,})Steps to Reproduce
Install @simplewebauthn/server version 10.0.0.
import{generateAuthenticationOptions,generateRegistrationOptions,verifyAuthenticationResponse,verifyRegistrationResponse,}from'@simplewebauthn/server'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
[nodemon] starting `node --env-file=.env --import ./instrument.js --import @swc-node/register/esm-register ./src/main.ts`
ReferenceError: generateChallenge is not defined
at Function.assign (<anonymous>)
at file:///Users/pascal/code/ips-hosting/api/node_modules/.pnpm/@simplewebauthn+server@10.0.0/node_modules/@simplewebauthn/server/esm/helpers/index.js?iitm=true:6:18
at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:485:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:109:5)
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/serverversion 10.0.0.Expected Result
Using
@simplewebauthn/serverusing Sentry intstrumentation in an ESM environment should work.Everything works fine when removing the
--import ./instrument.jsflag.Actual Result