Title: Cannot compile TS with @sentry/node without lib: DOM definitions present · Issue #4449 · getsentry/sentry-javascript · GitHub
Open Graph Title: Cannot compile TS with @sentry/node without lib: DOM definitions present · Issue #4449 · getsentry/sentry-javascript
X Title: Cannot compile TS with @sentry/node without lib: DOM definitions present · Issue #4449 · 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/4449
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot compile TS with @sentry/node without lib: DOM definitions present","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\n6.17.1\r\n```\r\n\r\n## Description\r\n\r\nThe `sentry/node` package incorrectly assumes there are types for DOM on the server. So when trying to compile a NodeJS app the following two error occurs:\r\n\r\n```\r\nnode_modules/@sentry/utils/dist/is.d.ts:65:55 - error TS2304: Cannot find name 'Event'.\r\n\r\n65 export declare function isEvent(wat: unknown): wat is Event;\r\n ~~~~~\r\n\r\nnode_modules/@sentry/utils/dist/is.d.ts:73:57 - error TS2304: Cannot find name 'Element'.\r\n\r\n73 export declare function isElement(wat: unknown): wat is Element;\r\n ~~~~~~~\r\n\r\nFound 2 errors.\r\n```\r\n\r\nTechnically this happens because we override the `lib` in TS config so there are no types for DOM, however, I think this is a correct assumption on the server-side, and adding simply `dom` to `lib` in TS config is not a good solution.\r\n\r\nThere is a ~3 year old related issue here: https://github.com/getsentry/sentry-javascript/issues/2266","author":{"url":"https://github.com/NoNameProvided","@type":"Person","name":"NoNameProvided"},"datePublished":"2022-01-25T05:58:09Z","url":"https://github.com/getsentry/sentry-javascript/issues/4449"}
| 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:c8f96b55-8b71-7c9e-d5a7-076840a96092 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A86A:26F6D6:10597C:16855C:6B04B13D |
| html-safe-nonce | 9ea2e5a1b060e0d033e6991ac3cd3015574af182cf64068df1ebeb8ee0ec2205 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODZBOjI2RjZENjoxMDU5N0M6MTY4NTVDOjZCMDRCMTNEIiwidmlzaXRvcl9pZCI6IjQwNDY2MTY1NTYyNzU1NDQzODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9925aac8d0adc6451475837a84c6423775ee3e23cef43cd57dfea995529af319 |
| hovercard-subject-tag | issue:1113459478 |
| 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/4449/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5c68af5453f4afc72cccc7e68ac37658a303ee4d7beee0f6f13f6f1691eb189/getsentry/sentry-javascript/issues/4449 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5c68af5453f4afc72cccc7e68ac37658a303ee4d7beee0f6f13f6f1691eb189/getsentry/sentry-javascript/issues/4449 |
| 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 | NoNameProvided |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1 |
| 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 | ffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b |
| 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