Skip to content

bluebird promisifyAll fails when using bun #18693

Closed

Description

@xd1gital

What version of Bun is running?

1.2.8+adab0f64f

What platform is your computer?

Linux 6.8.0-56-generic x86_64 x86_64 (Ubuntu 24.04)

What steps can reproduce the bug?

test.js content

const Promise = require('bluebird')
const crypto = Promise.promisifyAll(require('crypto'))
console.log('NO ERROR');

run:
bun test.js

What is the expected behavior?

NO ERROR

What do you see instead?

62 | function promisifiableMethods(obj, suffix, suffixRegexp, filter) {
63 |     var keys = util.inheritedDataKeys(obj);
64 |     var ret = [];
65 |     for (var i = 0; i < keys.length; ++i) {
66 |         var key = keys[i];
67 |         var value = obj[key];
                         ^
TypeError: Can only call JSDiffieHellman.verifyError on instances of JSDiffieHellman
 code: "ERR_INVALID_THIS"

      at promisifiableMethods (/media/projects/book/v2.5.307/node_modules/bluebird/js/release/promisify.js:67:21)
      at promisifyAll (/media/projects/book/v2.5.307/node_modules/bluebird/js/release/promisify.js:241:9)
      at <anonymous> (/media/projects/book/v2.5.307/node_modules/bluebird/js/release/promisify.js:305:13)
      at <anonymous> (/media/projects/book/v2.5.307/test.js:2:24)

Bun v1.2.8 (Linux x64)

Additional information

No response

Activity

  1. changed the title [-]bluebirth promisifyAll fails when using bun[/-] [+]bluebird promisifyAll fails when using bun[/+] on Apr 1, 2025
  2. dylan-conway commented on Apr 1, 2025

    @dylan-conway
    Member

    Looks like verifyError should not be in the prototype and instead should be put on the instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions