You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was reproduced with pnpm, npm and bun.
For readability, the provided log comes from npm.
I can only reproduce this using tsc. The provided setup code does not provide any issues when ran with tsx and the Buntime (bun index.ts). I assume this is because tsx and the Buntime do the equiviliant of tsc's skipLibCheck.
node_modules/@opentelemetry/instrumentation-amqplib/build/src/amqplib.d.ts:7:15 - error TS2416: Property 'init'intype'AmqplibInstrumentation' is not assignable to the same property in base type'InstrumentationBase'.
Type '() => InstrumentationNodeModuleDefinition' is not assignable to type'() => void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'.
Type 'InstrumentationNodeModuleDefinition' is not assignable to type'void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'.
Type 'InstrumentationNodeModuleDefinition' is not assignable to type'InstrumentationModuleDefinition' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties. Types of property 'patch' are incompatible. Type '((exports: any, moduleVersion?: string | undefined) => any) | undefined' is not assignable to type '(moduleExports: any, moduleVersion?: string | undefined) => any'. Type 'undefined' is not assignable to type '(moduleExports: any, moduleVersion?: string | undefined) => any'.7 protected init(): InstrumentationNodeModuleDefinition; ~~~~node_modules/@opentelemetry/instrumentation-aws-lambda/build/src/instrumentation.d.ts:11:5 - error TS2416: Property 'init' in type 'AwsLambdaInstrumentation' is not assignable to the same property in base type 'InstrumentationBase'. Type '() => InstrumentationNodeModuleDefinition[]' is not assignable to type '() => void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'. Type 'InstrumentationNodeModuleDefinition[]' is not assignable to type 'void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'. Type 'InstrumentationNodeModuleDefinition[]' is not assignable to type 'InstrumentationModuleDefinition[]'. Type 'InstrumentationNodeModuleDefinition' is not assignable to type 'InstrumentationModuleDefinition' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.11 init(): InstrumentationNodeModuleDefinition[]; ~~~~node_modules/@opentelemetry/instrumentation-bunyan/build/src/instrumentation.d.ts:5:15 - error TS2416: Property 'init' in type 'BunyanInstrumentation' is not assignable to the same property in base type 'InstrumentationBase'. Type '() => InstrumentationNodeModuleDefinition[]' is not assignable to type '() => void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'. Type 'InstrumentationNodeModuleDefinition[]' is not assignable to type 'void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'.5 protected init(): InstrumentationNodeModuleDefinition[]; ~~~~node_modules/@opentelemetry/instrumentation-cassandra-driver/build/src/instrumentation.d.ts:6:15 - error TS2416: Property 'init' in type 'CassandraDriverInstrumentation' is not assignable to the same property in base type 'InstrumentationBase'. Type '() => InstrumentationNodeModuleDefinition' is not assignable to type '() => void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'. Type 'InstrumentationNodeModuleDefinition' is not assignable to type 'void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'.6 protected init(): InstrumentationNodeModuleDefinition; ~~~~node_modules/@opentelemetry/instrumentation-connect/build/src/instrumentation.d.ts:9:5 - error TS2416: Property 'init' in type 'ConnectInstrumentation' is not assignable to the same property in base type 'InstrumentationBase'. Type '() => InstrumentationNodeModuleDefinition[]' is not assignable to type '() => void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'. Type 'InstrumentationNodeModuleDefinition[]' is not assignable to type 'void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'.9 init(): InstrumentationNodeModuleDefinition[]; ~~~~node_modules/@opentelemetry/instrumentation-cucumber/build/src/instrumentation.d.ts:6:5 - error TS2416: Property 'init' in type 'CucumberInstrumentation' is not assignable to the same property in base type 'InstrumentationBase'. Type '() => InstrumentationNodeModuleDefinition[]' is not assignable to type '() => void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'. Type 'InstrumentationNodeModuleDefinition[]' is not assignable to type 'void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[]'.6 init(): InstrumentationNodeModuleDefinition[]; ~~~~
The text was updated successfully, but these errors were encountered:
Type 'InstrumentationNodeModuleDefinition' is not assignable to type 'InstrumentationModuleDefinition' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Closing this as it looks like a duplicate of #3713
TypeScript emits InstrumentationNodeModuleDefinition with " | undefined"
for some reason, making it incompatible with
InstrumentationModuleDefinition under exactOptionalPropertyTypes.
TypeScript emits InstrumentationNodeModuleDefinition with " | undefined"
for some reason, making it incompatible with
InstrumentationModuleDefinition under exactOptionalPropertyTypes.
alecmev
added a commit
to alecmev/opentelemetry-js
that referenced
this issue
Jul 16, 2024
TypeScript emits InstrumentationNodeModuleDefinition with " | undefined"
for some reason, making it incompatible with
InstrumentationModuleDefinition under exactOptionalPropertyTypes.
What happened?
Steps to Reproduce
Expected Result
The app builds
Actual Result
The app triggers a build error for every individual instrumentation installed.
Additional Details
In this example, the following instrumentations are installed through
sentry@1.8.0
:This was reproduced with pnpm, npm and bun.
For readability, the provided log comes from npm.
I can only reproduce this using
tsc
. The provided setup code does not provide any issues when ran withtsx
and the Buntime (bun index.ts
). I assume this is because tsx and the Buntime do the equiviliant of tsc'sskipLibCheck
.OpenTelemetry Setup Code
package.json
Relevant log output
The text was updated successfully, but these errors were encountered: