Closed
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 affected event from your Sentry account
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
Version:
6.17.1
Description
The 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:
node_modules/@sentry/utils/dist/is.d.ts:65:55 - error TS2304: Cannot find name 'Event'.
65 export declare function isEvent(wat: unknown): wat is Event;
~~~~~
node_modules/@sentry/utils/dist/is.d.ts:73:57 - error TS2304: Cannot find name 'Element'.
73 export declare function isElement(wat: unknown): wat is Element;
~~~~~~~
Found 2 errors.
Technically 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.
There is a ~3 year old related issue here: #2266