Skip to content

Node types leak into browser environment when importing @opentelemetry/core #5916

@Joozty

Description

@Joozty

What happened?

Steps to Reproduce

The issue is pretty simple: if you add import '@opentelemetry/core' to your project, @types/node get automatically added to the global scope.

If you're working in a browser environment, this causes problems because your project now has node types and have conflicts.

The root cause is a reference directive to @types/node in the file performance.d.ts. This directive forces @types/node types to be included globally, even when you’re not using Node.

Image

Expected Result

Image

Actual Result

Image

Additional Details

OpenTelemetry Setup Code

package.json

Relevant log output

Operating System and Version

No response

Runtime and Version

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpkg:corepriority:p3Bugs which cause problems in user apps not related to correctness (performance, memory use, etc)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions