sentry-javascript: Prisma Integration Incompatible with 5.0.0

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/serverless

SDK Version

7.58.1

Framework Version

No response

Link to Sentry event

No response

SDK Setup

import * as Sentry from '@sentry/serverless';
import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient();
Sentry.AWSLambda.init({
  dsn: process.env.SENTRY_DSN,
  environment: process.env.STAGE,
  tracesSampleRate: 1.0,
  release: process.env.VERSION,
  integrations: [new Sentry.AWSLambda.Integrations.Prisma({ client: prisma })],
});

Steps to Reproduce

  1. Use @vendia/serverless-express
  2. Use serverless-offline
  3. yarn start
  4. Navigate to any route

Expected Result

Route would load as previous.

Actual Result

✖ Unhandled exception in handler 'api'.
✖ TypeError: Converting circular structure to JSON
      --> starting at object with constructor 'zr'
      |     property 'client' -> object with constructor 't'
      --- property '_fetcher' closes the circle
      at JSON.stringify (<anonymous>)
      at new Prisma (/Volumes/Projects/xxxxx-api/node_modules/@sentry-internal/tracing/cjs/node/integrations/prisma.js:51:93)
      at init (/Volumes/Projects/xxxxx-api/.build/helper/sentry.js:39:24)
      at configureExpress (/Volumes/Projects/xxxxx-api/.build/helper/sentry.js:51:22)
      at Object.<anonymous> (/Volumes/Projects/xxxxx-api/.build/api/app.js:28:31)
      at Module._compile (node:internal/modules/cjs/loader:1196:14)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
      at Module.load (node:internal/modules/cjs/loader:1074:32)
      at Function.Module._load (node:internal/modules/cjs/loader:909:12)
      at Module.require (node:internal/modules/cjs/loader:1098:19)
✖ Converting circular structure to JSON
      --> starting at object with constructor 'zr'
      |     property 'client' -> object with constructor 't'
      --- property '_fetcher' closes the circle

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I am gonna remove the JSON.stringify call. It’s unnecessarily dangerous in this context since it will be evaluated before we even decide if we wanna log or not - not to mention the performance impact.

#8745

Fix has been released.

While I was preparing the reproducible, I’ve noticed the problem being solved when upgrading Prisma to the latest release (same as Sentry). @mwillbanks, maybe you should do the same?

@janpio I have previewFeatures = [“fullTextSearch”, “postgresqlExtensions”] set