We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/edeesis/kafkajs-nest
Attempt to re-use the KafkaJS KafkaConfig typing in the Nest MicroserviceOptions. You'll get a typescript error as screenshotted above.
import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { KafkaConfig } from 'kafkajs'; import { MicroserviceOptions, Transport } from '@nestjs/microservices'; async function bootstrap() { const app = await NestFactory.create(AppModule); const config: KafkaConfig = { clientId: 'client-id', brokers: process.env.KAFKA_BROKERS.split(','), }; await app.connectMicroservice<MicroserviceOptions>({ transport: Transport.KAFKA, options: { client: config, }, }); await app.listen(3000); }
Typings should match.
I'm also curious why there's a need for separate typings, rather than using the typings exported from kafkajs.
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
No response
10.x
{ "dependencies": { "@nestjs/common": "^10.3.0", "@nestjs/config": "^3.1.1", "@nestjs/core": "^10.3.0",, "@nestjs/microservices": "^10.3.0", "kafkajs": "^2.2.4", } }
Change was done in kafkajs 2.2.1
20.x
The text was updated successfully, but these errors were encountered:
peer dependency & strictLibCheck = true -> TS errors
Would you like to create a PR with updated types?
Sorry, something went wrong.
fix: nestjs#13077 KafkaJs typing consistency
5683d27
@kamilmysliwiec Done, thanks!
#13084
Merge pull request #13084 from edeesis/fix-13077
c7e1e24
fix: #13077 KafkaJs typing consistency
No branches or pull requests
Is there an existing issue for this?
Current behavior
Minimum reproduction code
https://github.com/edeesis/kafkajs-nest
Steps to reproduce
Attempt to re-use the KafkaJS KafkaConfig typing in the Nest MicroserviceOptions. You'll get a typescript error as screenshotted above.
Expected behavior
Typings should match.
I'm also curious why there's a need for separate typings, rather than using the typings exported from kafkajs.
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
10.x
Packages versions
Change was done in kafkajs 2.2.1
Node.js version
20.x
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: