Skip to content
New issue

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

Documented installation method doesn't work with Node 18 #1702

Open
hbielenia opened this issue Feb 8, 2023 · 2 comments
Open

Documented installation method doesn't work with Node 18 #1702

hbielenia opened this issue Feb 8, 2023 · 2 comments

Comments

@hbielenia
Copy link

Node version: 18.14.0
Bluebird version: 3.7.2

Hello, I would like to use Bluebird instead of native Promises because native stack traces give me no clue where to look for errors that are happening. I tried installation method described right there on getting started page:

import * as Promise from 'bluebird';

This works fine. Unfortunately, trying to call Promise.config() results in an error:

TypeError: Promise.config is not a function

This seems to indicate that the native Promise doesn't get overwritten. However, googling doesn't turn many results on that, which probably means that this isn't a widely encountered problem but only something wrong with my setup.

I'm enclosing an example source code file. Executing it with node bluebirdtest.js give me the aforementioned error.

bluebirdtest.tar.gz

@benjamingr
Copy link
Collaborator

Hello, I would like to use Bluebird instead of native Promises because native stack traces give me no clue where to look for errors that are happening

We fixed native stack traces in Node.js with async functions and native promises a while ago (circa 2018) - can you outline what doesn't work?


This seems to indicate that the native Promise doesn't get overwritten

I can't extract the tar.gz file here (on mobile) can you upload a gist or a gh repo?

@hbielenia
Copy link
Author

hbielenia commented Feb 9, 2023

We fixed native stack traces in Node.js with async functions and native promises a while ago (circa 2018) - can you outline what doesn't work?

I added Promises around Node's http callback-based utility functions and I'm getting an error like this one:

node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED ::1:80
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
Emitted 'error' event on ClientRequest instance at:
    at Socket.socketErrorListener (node:_http_client:502:9)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '::1',
  port: 80
}

Node.js v18.14.0

The error itself is pretty straightforward, but stack trace doesn't show where in my code does this call originate. After Googling, I learned that Bluebird is supposedly capable of longer stack traces and I want to check if it would do the job here.

I can't extract the tar.gz file here (on mobile) can you upload a gist or a gh repo?

Sure thing: https://gist.github.com/hbielenia/6dc79ded33f461dcf971002cd077b554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants