confluentinc / confluentinc/confluent-kafka-javascript

Confluent Kafka JavaScript should not extend Promise for maximum compatibility

Open
#149 0 comments 0 reactions 0 assignees View on GitHub
status:waiting-for-interest
Dominant language
TypeScript
Stars
304
Forks
45
Avg merge
11h 47m
Merged PRs (30d)
5

Description

**Environment Information**
- OS: Ubuntu 22.04.5 LTS
- Node Version: 20.18.0
- NPM Version: 10.8.2
- C++ Toolchain: g++
- confluent-kafka-javascript version: 0.4.0

**Steps to Reproduce**

Use Bluebird promises in your application.

```
global.Promise = require('bluebird');
```

Then you will receive the following error:

```
ERROR: TypeError: the promise constructor cannot be invoked directly

See http://goo.gl/MqrFmX

at check (/node_modules/bluebird/js/release/promise.js:86:15)
at new Promise (/node_modules/bluebird/js/release/promise.js:96:9)
at new DeferredPromise (/app/node_modules/@confluentinc/kafka-javascript/lib/kafkajs/_common.js:647:5)
```

**confluent-kafka-javascript Configuration Settings**

**Additional context**

Unfortunately, we have an older NodeJS application which heavily uses Bluebird promises. I'm not sure whether porting it to use native promises will happen anytime soon.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.