Skip to content

Usage of TextEncoderCommon causes compiler error in a setup without DOM Library #5199

@smirowstanitzok

Description

@smirowstanitzok

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/node

SDK Version

7.0.0

Framework Version

No response

Link to Sentry event

No response

Steps to Reproduce

  1. Setup a node project with typescript but without including DOM. For example tsconfig.json:
{
  "compilerOptions": {
  ...
  "lib": ["ES2020"],
  ...
  }
}
  1. Install the newest version of @sentry/node: npm install @sentry/node.
  2. Use tsc to compile the project.

Expected Result

The code can compile cleanly.

Actual Result

With #5004 comes the usage of TextEncoderCommon. This forces us to use the DOM library, which we can't and actually don't want to do.

Error: node_modules/@sentry/types/types/transport.d.ts(15,39): error TS2304: Cannot find name 'TextEncoderCommon'.

Maybe you can find an alternative without using the DOM library. Maybe more packages as a dependency can be a possible way. That would help us a lot to continue using sentry with pleasure. Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions