Title: "mod.require is not a function" Error after upgrading from 5.23.0 to >=5.24.0 · Issue #2971 · getsentry/sentry-javascript · GitHub
Open Graph Title: "mod.require is not a function" Error after upgrading from 5.23.0 to >=5.24.0 · Issue #2971 · getsentry/sentry-javascript
X Title: "mod.require is not a function" Error after upgrading from 5.23.0 to >=5.24.0 · Issue #2971 · getsentry/sentry-javascript
Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javascript/releases Provide a link to the aff...
Open Graph Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
X Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/2971
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"mod.require is not a function\" Error after upgrading from 5.23.0 to >=5.24.0 ","articleBody":"\u003c!-- Requirements: please go through this checklist before opening a new issue -->\r\n\r\n- [x] Review the documentation: https://docs.sentry.io/\r\n- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues\r\n- [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n- [ ] Provide a link to the affected event from your Sentry account\r\n\r\n## Package + Version\r\n\r\n- [ ] `@sentry/browser`\r\n- [x] `@sentry/node`\r\n- [ ] `raven-js`\r\n- [ ] `raven-node` _(raven for node)_\r\n- [ ] other:\r\n\r\n### Version:\r\n\r\n```\r\n>=5.24.0\r\n```\r\n\r\n## Description\r\n\r\nHello, we use Sentry for our Serverless applications which use NestJS and the [nest-raven](https://github.com/mentos1386/nest-raven) library that implements an interceptor to catch the errors and report them to Sentry.io and everything is bundled using Webpack. After we upgraded from `5.23.0` to the last version `5.26.0` we noticed that when an exception happens we receive an Internal Server Error and the original Exception is not reported to Sentry.io because it is the Sentry library that is having problems. The backend logs we have are:\r\n\r\n```\r\n | 2020-10-13T14:51:20.131-04:00 | TypeError: mod.require is not a function\r\n-- | -- | --\r\n | 2020-10-13T14:51:20.131-04:00 | at dynamicRequire (/var/task/src/adapters/graphql/handler.js:79802:16)\r\n | 2020-10-13T14:51:20.131-04:00 | at /var/task/src/adapters/graphql/handler.js:79860:39\r\n | 2020-10-13T14:51:20.131-04:00 | at Array.forEach (\u003canonymous>)\r\n | 2020-10-13T14:51:20.131-04:00 | at extractNodeRequestData (/var/task/src/adapters/graphql/handler.js:79845:10)\r\n | 2020-10-13T14:51:20.131-04:00 | at Module.parseRequest (/var/task/src/adapters/graphql/handler.js:131937:61)\r\n | 2020-10-13T14:51:20.131-04:00 | at RavenInterceptor.captureGraphQLException (/var/task/src/adapters/graphql/handler.js:645524:42)\r\n | 2020-10-13T14:51:20.131-04:00 | at Sentry.withScope (/var/task/src/adapters/graphql/handler.js:645514:45)\r\n | 2020-10-13T14:51:20.131-04:00 | at Hub.withScope (/var/task/src/adapters/graphql/handler.js:654823:13)\r\n | 2020-10-13T14:51:20.131-04:00 | at callOnHub (/var/task/src/adapters/graphql/handler.js:13438:28)\r\n | 2020-10-13T14:51:20.131-04:00 | at Module.withScope (/var/task/src/adapters/graphql/handler.js:13572:5)\r\n```\r\nAfter analyzing the bundle we noticed that the it happens in the `dynamicRequire` function specifically when it's called from [packages/utils/src/node.ts line 93](https://github.com/getsentry/sentry-javascript/blob/master/packages/utils/src/node.ts#L93) which was introduced in version `5.24.0`.\r\n\r\nChecking the stacktrace it happens when `Handlers.parseRequests` is called from the Nest-Raven [library we use](https://github.com/mentos1386/nest-raven/blob/v6.0.0-alpha.2/lib/raven.interceptor.ts#L75)\r\n\r\nSo far the workaround is to keep using `@sentry/node@5.23.0` where the error does not happen.","author":{"url":"https://github.com/sergio-dreamcode","@type":"Person","name":"sergio-dreamcode"},"datePublished":"2020-10-13T19:56:20Z","url":"https://github.com/getsentry/sentry-javascript/issues/2971"}
| 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:f8a1ba9e-64a6-9445-f776-3385c233b20f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A46C:125D11:10B050:16533B:6B042DA9 |
| html-safe-nonce | c2e8056f7aedcc3d9dc4ec853d2a4c00a2f7719e163d97c6404a8af2311e33a0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDZDOjEyNUQxMToxMEIwNTA6MTY1MzNCOjZCMDQyREE5IiwidmlzaXRvcl9pZCI6IjgzMTU1MDY5NTgzMzc4NDY2OTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c6fb76aeb28e33b6d46710b384ef30794f6cadd879bd50abfad2fe5f3baedaca |
| hovercard-subject-tag | issue:720753673 |
| 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/2971/issue_layout |
| twitter:image | https://opengraph.githubassets.com/beb894c53d2b85fa757de027aa9725f89464d9402c74ee6f1ee9c2e443dc4696/getsentry/sentry-javascript/issues/2971 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/beb894c53d2b85fa757de027aa9725f89464d9402c74ee6f1ee9c2e443dc4696/getsentry/sentry-javascript/issues/2971 |
| og:image:alt | Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sergio-dreamcode |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| 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 | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| 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