GithubHelp home page GithubHelp logo

fastify-sentry's Issues

Cannot read property of null (performance hooks)

Thank you so much for making this!

[App]     reqId: "req-h"
[App]     res: {
[App]       "statusCode": 500
[App]     }
[App]     responseTime: 0.30369997024536133
[App]     err: {
[App]       "type": "TypeError",
[App]       "message": "Cannot read properties of null (reading 'onSend')",
[App]       "stack":
[App]           TypeError: Cannot read properties of null (reading 'onSend')
[App]               at C:\Users\matth\OneDrive\Desktop\Engineering\ForkForecast\backend\node_modules\.pnpm\@[email protected]\node_modules\@serdnam\fastify-sentry\dist\index.js:184:27
[App]               at Object.nextHookWithoutPayload (C:\Users\matth\OneDrive\Desktop\Engineering\ForkForecast\backend\node_modules\.pnpm\@[email protected]\node_modules\@serdnam\fastify-sentry\dist\index.js:201:32)
[App]               at onResponseIterator (C:\Users\matth\OneDrive\Desktop\Engineering\ForkForecast\backend\node_modules\.pnpm\[email protected]\node_modules\fastify\lib\reply.js:775:10)
[App]               at next (C:\Users\matth\OneDrive\Desktop\Engineering\ForkForecast\backend\node_modules\.pnpm\[email protected]\node_modules\fastify\lib\hooks.js:185:16)
[App]               at hookRunner (C:\Users\matth\OneDrive\Desktop\Engineering\ForkForecast\backend\node_modules\.pnpm\[email protected]\node_modules\fastify\lib\hooks.js:207:3)
[App]               at ServerResponse.onResFinished (C:\Users\matth\OneDrive\Desktop\Engineering\ForkForecast\backend\node_modules\.pnpm\[email protected]\node_modules\fastify\lib\reply.js:758:7)
[App]               at ServerResponse.emit (node:events:525:35)
[App]               at ServerResponse.emit (node:domain:489:12)
[App]               at onFinish (node:_http_outgoing:950:10)
[App]               at callback (node:internal/streams/writable:555:21)
[App]     }```

My code (mostly copied from example)

```import fp from 'fastify-plugin';
import { FastifySentry } from '@serdnam/fastify-sentry';

export default fp(async (fastify, opts) => {
  fastify.register(FastifySentry, {
    sentryOptions: {
        dsn: process.env.SENTRY_DSN,
    },
    performance: {
      hooks: [
        'onRequest',
        'preParsing',
        'preValidation',
        'preHandler',
        'preSerialization',
        'onSend'
      ],
    }
  });
});

If I remove all but "onRequest" there are no errors, but I'm also not seeing any performance data in the Sentry dashboard (errors work)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.