Summary
The package.json for @confluentinc/kafka-javascript@1.6.0 references a non-existent type definition file (types/index.d.ts), causing TypeScript to fail when resolving types and namespace exports.
Details
When analyzing the package using arethetypeswrong, the tool reports a missing named exports. Upon inspection of the package:
- The Problem: The
package.json specifies "types": "types/index.d.ts", but this file does not exist in the published package.
- Actual Structure: The type definitions are located at
index.d.ts in the root directory, which exports:
export * from './types/rdkafka';
export * as RdKafka from './types/rdkafka';
export * as KafkaJS from './types/kafkajs';
- Impact: Because TypeScript cannot find the file specified in the
types field, it fails to resolve:
- The namespace exports (
RdKafka and KafkaJS)
- All type definitions from the package
- IntelliSense and type checking for consumers
Impact
- TypeScript projects consuming this package will experience:
- Complete failure to resolve type definitions
- Missing IntelliSense/autocomplete support
- TypeScript compiler errors when importing from the package
- Inability to use namespace exports (
RdKafka.* and KafkaJS.*)
Expected Behavior
The package.json types field should point to an existing type definition file that TypeScript can resolve.
Actual Behavior
The package.json points to types/index.d.ts which does not exist, causing TypeScript to fail when trying to resolve types and namespace exports.
Steps to Reproduce
- Install
@confluentinc/kafka-javascript@1.6.0:
npm install @confluentinc/kafka-javascript@1.6.0
- Extract and inspect the package:
npm pack @confluentinc/kafka-javascript@1.6.0
tar -xzf confluentinc-kafka-javascript-1.6.0.tgz
ls package/types/index.d.ts # This file does not exist
- Check
package.json:
{
"types": "types/index.d.ts" // Points to non-existent file
}
- Analyze using arethetypeswrong
- Observe the missing namespace/type resolution error
Environment
Additional Context
The root index.d.ts file exists and contains the proper type exports, including namespace exports using export * as. However, because the package.json types field points to a non-existent path, TypeScript cannot resolve these exports.
Related
PS: this issue description was generated with AI, so take it with a grain of salt
Summary
The
package.jsonfor@confluentinc/kafka-javascript@1.6.0references a non-existent type definition file (types/index.d.ts), causing TypeScript to fail when resolving types and namespace exports.Details
When analyzing the package using arethetypeswrong, the tool reports a missing named exports. Upon inspection of the package:
package.jsonspecifies"types": "types/index.d.ts", but this file does not exist in the published package.index.d.tsin the root directory, which exports:typesfield, it fails to resolve:RdKafkaandKafkaJS)Impact
RdKafka.*andKafkaJS.*)Expected Behavior
The
package.jsontypesfield should point to an existing type definition file that TypeScript can resolve.Actual Behavior
The
package.jsonpoints totypes/index.d.tswhich does not exist, causing TypeScript to fail when trying to resolve types and namespace exports.Steps to Reproduce
@confluentinc/kafka-javascript@1.6.0:npm pack @confluentinc/kafka-javascript@1.6.0 tar -xzf confluentinc-kafka-javascript-1.6.0.tgz ls package/types/index.d.ts # This file does not existpackage.json:{ "types": "types/index.d.ts" // Points to non-existent file }Environment
@confluentinc/kafka-javascript@1.6.0Additional Context
The root
index.d.tsfile exists and contains the proper type exports, including namespace exports usingexport * as. However, because thepackage.jsontypesfield points to a non-existent path, TypeScript cannot resolve these exports.Related
PS: this issue description was generated with AI, so take it with a grain of salt