Title: Typescript - @sentry/utils references node types · Issue #2013 · getsentry/sentry-javascript · GitHub
Open Graph Title: Typescript - @sentry/utils references node types · Issue #2013 · getsentry/sentry-javascript
X Title: Typescript - @sentry/utils references node types · Issue #2013 · 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 Package + Version @sentry...
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/2013
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Typescript - @sentry/utils references node types","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\r\n## Package + Version\r\n\r\n- [x] `@sentry/browser`\r\n- [ ] `@sentry/node`\r\n- [ ] `raven-js`\r\n- [ ] `raven-node` _(raven for node)_\r\n- [x] other: `@sentry/utils`\r\n\r\n### Version:\r\n\r\n```\r\n5.0.7\r\n5.0.6\r\n```\r\n\r\n## Description\r\n\r\nThe browser package relies on:\r\n`@sentry/utils/dist/misc.d.ts` which in turn relies on node type definitions:\r\n```typescript\r\n/// \u003creference types=\"node\" />\r\n\r\n// ...\r\n\r\nexport declare function dynamicRequire(mod: NodeModule, request: string): any;\r\n```\r\n\r\nThis causes the following errors when used in conjunction with the [Fork TS Checker Webpack Plugin](https://github.com/Realytics/fork-ts-checker-webpack-plugin):\r\n\r\n> ERROR in node_modules/@sentry/utils/dist/misc.d.ts(1,23):\r\n> TS2688: Cannot find type definition file for 'node'.\r\n> ERROR in /node_modules/@sentry/utils/dist/misc.d.ts(16,45):\r\n> TS2304: Cannot find name 'NodeModule'.\r\n\r\nThese can be resolved by either including `@types/node` in your package.json file or by making a file in a `typeRoots` directory named `node.d.ts` with the following contents:\r\n\r\n```typescript\r\ndeclare module \"node\" {\r\n interface NodeModule {}\r\n\r\n // this ns may no longer be needed as of 5.0.7\r\n namespace NodeJS {\r\n export type Global = any\r\n }\r\n}\r\n```\r\n\r\nIt seems strange that a browser library would rely on node typedefs, but these errors **do not** seem to occur in a more vanilla Typescript/Webpack setup. So it's possible there's nothing to fix here, but hopefully the above notes might be useful to others who encounter this issue.","author":{"url":"https://github.com/dleavitt","@type":"Person","name":"dleavitt"},"datePublished":"2019-04-10T22:06:04Z","url":"https://github.com/getsentry/sentry-javascript/issues/2013"}
| 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:09e00713-7461-8b5a-eb06-8c0b69f3f9cc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B04E:1C89CF:36FF9:49C10:6B0427ED |
| html-safe-nonce | eea4c894490ed83b3183e145851d2b1347856dd532ceddf6164d06517a4df55d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDRFOjFDODlDRjozNkZGOTo0OUMxMDo2QjA0MjdFRCIsInZpc2l0b3JfaWQiOiIzOTU1OTg5ODU0Nzk1OTYwMTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ef520475ff844d7818c585f0b5a28e00bf7386c41b050b0d6fb52d9eee0dbf0a |
| hovercard-subject-tag | issue:431738968 |
| 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/2013/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1229dcfca10b823b546c5747136323c9ca8809d2d4b3fa447b4c8d5a9ad61b8d/getsentry/sentry-javascript/issues/2013 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1229dcfca10b823b546c5747136323c9ca8809d2d4b3fa447b4c8d5a9ad61b8d/getsentry/sentry-javascript/issues/2013 |
| 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 | dleavitt |
| 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