Title: Postgres Integration was unable to require `pg` package when using webpack · Issue #4099 · getsentry/sentry-javascript · GitHub
Open Graph Title: Postgres Integration was unable to require `pg` package when using webpack · Issue #4099 · getsentry/sentry-javascript
X Title: Postgres Integration was unable to require `pg` package when using webpack · Issue #4099 · getsentry/sentry-javascript
Description: 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 workaroun...
Open Graph Description: 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 @kamilo...
X Description: Package + Version "@sentry/node": "^6.13.3" "@sentry/tracing": "^6.13.3" "webpack": "^5.60.0" "webpack-cli": "^4.9.1"...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4099
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Postgres Integration was unable to require `pg` package when using webpack","articleBody":"## Package + Version\r\n\r\n- \"@sentry/node\": \"^6.13.3\"\r\n- \"@sentry/tracing\": \"^6.13.3\"\r\n- \"webpack\": \"^5.60.0\"\r\n- \"webpack-cli\": \"^4.9.1\"\r\n\r\nThis is similar to issue found [here](https://github.com/getsentry/sentry-javascript/issues/3293) (issue 3293) with a workaround from @kamilogorek. I can't however get the workaround to work.\r\n\r\n## Issue\r\n \r\nWhen trying to use the `Tracing.Integrations.Postgres()` integration to get database traces the pg package can for some reason not be required. \r\n\r\n\u003cimg width=\"661\" alt=\"CleanShot 2021-10-28 at 14 20 13@2x\" src=\"https://user-images.githubusercontent.com/1317734/139254038-a41da43d-cfc5-4346-b2a3-ef8a5e0ffa09.png\">\r\n\r\n\r\n\r\n\r\n## Previously proposed workaround\r\n\r\nIn [issue 3293](https://github.com/getsentry/sentry-javascript/issues/3293) the mentioned workaround is to add [magic comments](https://webpack.js.org/configuration/module/#moduleparserjavascriptcommonjsmagiccomments)\r\n\r\n```\r\nmodule: {\r\n parser: {\r\n javascript: {\r\n commonjsMagicComments: true,\r\n },\r\n },\r\n```\r\nEven with workaround [implemented](https://github.com/riha/sentry-webpack-postgres/blob/1cdc1332885704f14af209b45efb186a748d1581/webpack.config.js#L14) I still however get the exact same error ... \r\n\r\n`Sentry Logger [Error]: Postgres Integration was unable to require `pg` package.`\r\n\r\n## Reproduce the issue\r\n\r\n👀 A repo for reproducing the issue can be found [here](https://github.com/riha/sentry-webpack-postgres) ","author":{"url":"https://github.com/riha","@type":"Person","name":"riha"},"datePublished":"2021-10-28T11:12:28Z","url":"https://github.com/getsentry/sentry-javascript/issues/4099"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ea840a80-d36e-dbaa-0f8c-a7016444df44 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8558:81334:357B6B:4ABE31:6B047829 |
| html-safe-nonce | 799effb23244e657970a0e78d74b72824d41caef8af8f6e0ed11cce770917718 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTU4OjgxMzM0OjM1N0I2Qjo0QUJFMzE6NkIwNDc4MjkiLCJ2aXNpdG9yX2lkIjoiMTUxOTk1NDYyODI0MTAyOTE2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d657ff90f834386fc5a536dd081bc103d7c84c9c5d42e4bf3e97424880b73d74 |
| hovercard-subject-tag | issue:1038389420 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/4099/issue_layout |
| twitter:image | https://opengraph.githubassets.com/17c7daa665bff324ea092a328c3ff28a31d843306887e4d2a6bc2f82c89e1bea/getsentry/sentry-javascript/issues/4099 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/17c7daa665bff324ea092a328c3ff28a31d843306887e4d2a6bc2f82c89e1bea/getsentry/sentry-javascript/issues/4099 |
| og:image:alt | 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 @kamilo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | riha |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width