Skip to content

Support for Logs in Next.js Edge Runtime #16151

Description

@AbhiPrasad

Hey team Sentry. Promising product evolution for sure, we are eager to try to integrating our logs with our error reporting. We've been added to the pilot, upgraded to @sentry/nextjs@9.14.0 and @sentry/node@9.14.0 and added import * as Sentry from '@sentry/nextjs' to our central logging lib.

Now when we start the Next.js (15.2.3) frontend, we get an error Export logger doesn't exist in target module. I've traced this down to an import of Sentry.logger in our middleware.ts, where we log each incoming request. I'm slightly puzzled, as I assumed this code is only used server-side, but it looks like it's somehow imported into the clientside bundle at least in development.

Anything I should be trying differently? Here's a minimal repro: https://github.com/stefnnn/next-turbo-middleware

Originally posted by @stefnnn in #15916 (comment)

Activity

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions