Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[instrumentation-mongodb] breaks build ((TS2304) Cannot find name 'Document') #1639

Closed
sberz opened this issue Aug 16, 2023 · 0 comments · Fixed by #1644 or #1651
Closed

[instrumentation-mongodb] breaks build ((TS2304) Cannot find name 'Document') #1639

sberz opened this issue Aug 16, 2023 · 0 comments · Fixed by #1644 or #1651
Labels
bug Something isn't working priority:p3 Bugs which cause problems in user apps not related to correctness (performance, memory use, etc)

Comments

@sberz
Copy link
Contributor

sberz commented Aug 16, 2023

What version of OpenTelemetry are you using?

@opentelemetry/api 1.4.1
@opentelemetry/auto-instrumentations-node 0.39.0 (uses @opentelemetry/instrumentation-mongodb 0.36.1)
@opentelemetry/sdk-node 0.41.2

What version of Node are you using?

18.17.1

What did you do?

  1. I tried to upgrade the following OpenTelemetry packages:
-      '@opentelemetry/auto-instrumentations-node': ^0.36.4
-      '@opentelemetry/sdk-node': ^0.36.0
+      '@opentelemetry/auto-instrumentations-node': ^0.39.0
+      '@opentelemetry/sdk-node': ^0.41.2
  1. Tried to build my application (Typescript strict mode; skipLibCheck: false)

What did you expect to see?

The application should still build.

What did you see instead?

With the new versions I can no longer build our application and get the following error:

[typescript] Error: common/temp/node_modules/.pnpm/@opentelemetry+instrumentation-mongodb@0.36.1_@opentelemetry+api@1.4.1/node_modules/@opentelemetry/instrumentation-mongodb/build/src/types.d.ts:49:27 - (TS2304) Cannot find name 'Document'.
Encountered 1 errors:
  [typescript] common/temp/node_modules/.pnpm/@opentelemetry+instrumentation-mongodb@0.36.1_@opentelemetry+api@1.4.1/node_modules/@opentelemetry/instrumentation-mongodb/build/src/types.d.ts:49:27 - (TS2304) Cannot find name 'Document'.
Error: Encountered TypeScript error

Additional context

Seems like #1190 got reintroduced by #1170

Removing the seemingly unused V4Connection type from types.d.ts fixes the build for me.

@sberz sberz added the bug Something isn't working label Aug 16, 2023
sberz added a commit to sberz/opentelemetry-js-contrib that referenced this issue Aug 18, 2023
The type `V4Connection` re-introduced in open-telemetry#1170 is missing any type
definitions or imports for `Document`, breaking the build with
typecricpt strict mode.
`V4Connection` in `types.ts` is not referenced anywhere (the type
definition in `internal-types.ts` is used. So lets just drop this type
definition.

BREAKING CHANGE: removes the broken exported type `V4Connection`.
Fixes open-telemetry#1639
sberz added a commit to sberz/opentelemetry-js-contrib that referenced this issue Aug 18, 2023
The type `V4Connection` re-introduced in open-telemetry#1170 is missing any type
definitions or imports for `Document`, breaking the build with
Typescript strict mode.
`V4Connection` in `types.ts` is not referenced anywhere (the type
definition in `internal-types.ts` is used. So lets just drop this type
definition.

BREAKING CHANGE: removes the broken exported type `V4Connection`.
Fixes open-telemetry#1639
sberz added a commit to sberz/opentelemetry-js-contrib that referenced this issue Aug 18, 2023
The type `V4Connection` re-introduced in open-telemetry#1170 is missing any type
definitions or imports for `Document`, breaking the build with
Typescript strict mode.
`V4Connection` in `types.ts` is not referenced anywhere (the type
definition in `internal-types.ts` is used. So lets just drop this type
definition.

BREAKING CHANGE: removes the broken exported type `V4Connection`.
Fixes open-telemetry#1639

Signed-off-by: Simon Berz <simon@berz.me>
@dyladan dyladan added priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect priority:p3 Bugs which cause problems in user apps not related to correctness (performance, memory use, etc) and removed priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect labels Aug 23, 2023
blumamir pushed a commit that referenced this issue Aug 26, 2023
The type `V4Connection` re-introduced in #1170 is missing any type
definitions or imports for `Document`, breaking the build with
Typescript strict mode.
`V4Connection` in `types.ts` is not referenced anywhere (the type
definition in `internal-types.ts` is used. So lets just drop this type
definition.

BREAKING CHANGE: removes the broken exported type `V4Connection`.
Fixes #1639

Signed-off-by: Simon Berz <simon@berz.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p3 Bugs which cause problems in user apps not related to correctness (performance, memory use, etc)
Projects
None yet
2 participants