Skip to content

Postgres Integration was unable to require pg package when using webpack #4099

Closed
@riha

Description

@riha

Package + Version

  • "@sentry/node": "^6.13.3"
  • "@sentry/tracing": "^6.13.3"
  • "webpack": "^5.60.0"
  • "webpack-cli": "^4.9.1"

This is similar to issue found here (issue 3293) with a workaround from @kamilogorek. I can't however get the workaround to work.

Issue

When trying to use the Tracing.Integrations.Postgres() integration to get database traces the pg package can for some reason not be required.

CleanShot 2021-10-28 at 14 20 13@2x

CleanShot 2021-10-28 at 14 20 52@2x

Previously proposed workaround

In issue 3293 the mentioned workaround is to add magic comments

module: {
  parser: {
    javascript: {
      commonjsMagicComments: true,
    },
  },

Even with workaround implemented I still however get the exact same error ...

Sentry Logger [Error]: Postgres Integration was unable to require pg package.

Reproduce the issue

👀 A repo for reproducing the issue can be found here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions