-
Notifications
You must be signed in to change notification settings - Fork 22
Missing Type Definition File Referenced in package.json for @confluentinc/[email protected] #403
Description
Summary
The package.json for @confluentinc/[email protected] 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.jsonspecifies"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.tsin 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
typesfield, it fails to resolve:- The namespace exports (
RdKafkaandKafkaJS) - All type definitions from the package
- IntelliSense and type checking for consumers
- The namespace exports (
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.*andKafkaJS.*)
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/[email protected]:npm install @confluentinc/[email protected]
- Extract and inspect the package:
npm pack @confluentinc/[email protected] 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
- Package:
@confluentinc/[email protected] - Analysis Tool: arethetypeswrong.github.io
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