Skip to content

Fastify integration does not work in ESM mode #12119

Description

@mohd-akram

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.2.1

Framework Version

No response

Link to Sentry event

No response

SDK Setup

// app.mjs
import * as Sentry from "@sentry/node";
import { fastify } from "fastify";
const app = fastify();
Sentry.setupFastifyErrorHandler(app);
const address = await app.listen();
console.info(`server listening on ${address}`);
// instrument.mjs
import * as Sentry from "@sentry/node";
Sentry.init({ dsn: process.env.SENTRY_DSN, debug: true });

Steps to Reproduce

  1. node --import ./instrument.mjs app.mjs

Expected Result

Works

Actual Result

[Sentry] Fastify is not instrumented. This is likely because you required/imported fastify before calling `Sentry.init()`.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions