Skip to content

Sentry.AWSLambda.init doesn't work with Netlify dev #3000

@tysonmatanich

Description

@tysonmatanich

I'm using @sentry/[email protected] (docs) with Netlify Functions (@netlify). It works great when deployed to Netlify, however when running locally with > netlify dev it fails with the following error:

{"errorMessage":"Cannot find module 'aws-sdk/global'\nRequire stack:\n- C:\Users...

Simple workaround incase others run into the issue:

const Sentry = require("@sentry/serverless");
if (process.env.NETLIFY_DEV === "true") {
  Sentry.init(settings);
} else {
  Sentry.AWSLambda.init(settings);
}

On a side note, the Sentry.AWSLambda.wrapHandler works fine with Netlify dev.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions