Questions tagged [bluebird]
Bluebird is a fully featured promise library for client and server JavaScript with focus on innovative features and performance.
1,871
questions
0
votes
2
answers
148
views
How to combine async await with Bluebird cancelable promises
I have an async operation that should be cancelable. So I decided to use Bluebird Promises to get it done.
However, when I try to run it, my code never completes, because (in case of the promise being ...
0
votes
0
answers
137
views
Why bluebird packages is not work in nestjs
I'm using these following packages:
@nestjs/core 9.0.0
bluebird 3.7.2
@types/bluebird 3.5.38
Here is my tsconfig.json:
{
"compilerOptions": {
"module": "commonjs",...
0
votes
0
answers
101
views
RUN npm run-script build within Dockerfile returned a non-zero code: 2
The Docker build is run as a step in the bitbucket pipelines.
After RUN npm run-script build, the console returned the follow error.
node_modules/@types/bluebird/index.d.ts(44,27): error TS1256: A ...
0
votes
1
answer
100
views
Overriding Promise implementation to Bluebird.Promise
I've got a scenario where promise will be undefined for some remote executions of a code base. Locally, it's running Node. Remotely, its running another runtime that doesn't have Promises. Bluebird ...
0
votes
0
answers
93
views
throwing Warning: a promise was rejected with a non-error: [object Object]
function fetch(options) {
return new Promise((resolve, reject) => {
this.request(options, (err, response, status, xhr) => {
console.log('err res', err, response);//#console2
...
1
vote
0
answers
157
views
Firebase Functions - why do I still receive unhandled error message after 'response received from function'
I thought that once the response was received from a cloud function that meant that the function terminated. How and why would I still receive 'Your function was killed because it raised an unhandled ...
2
votes
0
answers
244
views
Get column values as array from SQLite in Node.js
I want to make sure that the addresses array is being updated but this code prints an empty array. There is only one field in the addresses table, and I want all rows of that field to be in the ...
0
votes
0
answers
581
views
Virtual size in docker is always increasing with puppeteer
I am developing a little program with nodejs and Puppeteer which goal is to generate a certain amount of PDF files. The program is working with the bluebird module in order to achieve concurrency. The ...
0
votes
2
answers
256
views
add some delays between request in promis.map using cheerio and nodejs?
I have following code:
urls have 5000 different url, when I try to grab and scrape these urls, I ran into a 500 Error, so I decide to add some delay between each request, I add the {concurrency: 1} ...
0
votes
1
answer
240
views
Can I still use BlueBird calls on Sequelize V6 in a transaction
For a project I have migrated from sequelize v5 --> v6
As mentioned here, cls-hooked should now be used instead of continuation-local-storage. so I am now using cls-hooked. Another breaking change ...
0
votes
0
answers
77
views
When to implement bluebird library over callbacks
This is my first time building a full stack react project so any help would be helpful.
Essentially I'm building an endpoint that I would really like to fulfill around 200 request a second. Now ...
0
votes
1
answer
503
views
throw new TypeError("expecting a function but got " + util.classString(fn)); TypeError: expecting a function but got [object Undefined]
While running node app.js the Express server is connecting properly and the MongoDB is connecting correctly, but I am facing a problem in the node module as mentioned above.
The complete log is pasted ...
0
votes
1
answer
271
views
Why re-throwing error in catch block having TypeError
I have a route handler in express.js and inside it, I am calling an asynchronous function which should return me some value. I am using bluebird promises to handle the promises. Below is a sample code....
0
votes
1
answer
250
views
XO Lint Issue Using Promise.map unicorn/no-array-method-this-argument
I am using XO for linting my code, and I cannot figure out why this lint error is being reported for the following code...
import Promise from 'bluebird';
const handler = items => {
return ...
0
votes
1
answer
81
views
Filling a database with after promises parsing a text file
I'm trying to build a db with bluebird and sqlite3 to manage a lot of "ingredients".
So far I've managed to parse a file and extrapolate some data from it using regex.
Every time a line ...
0
votes
1
answer
540
views
Bluebird / Typescript Error: 'this' context of is not assignable to method's 'this'
I have a series of methods (some asynchronous and some not) that I would like to use bluebird.each to process in order. Here is a dumbed down example:
import bluebird from 'bluebird';
const delay = (...
0
votes
0
answers
107
views
Which is the best way to retrieve data from a remote server using concurrent calls?
I'm working on retrieving data like Products, Orders eCommerce platforms such as BigCommerce, Shopify, etc., and save it in our own databases. To improve the data retrieval speed from their APIs, we'...
3
votes
1
answer
3k
views
How to stop a Promise.map execution after an error with Bluebird
I've a very large amount of data to create on the database and I want to generate them in parallel with a concurrency limit. In order to do that I'm using the Promise.map method from bluebird with the ...
0
votes
1
answer
381
views
Managing connection pool issue when updating several rows in oracle db with node.js and knex.js
I'm using a Node.js application which inserts and updates data on a Oracle database. There is a situation where I need to update a column value of a table for number of rows within a single API call. ...
8
votes
0
answers
928
views
fs.writeFile crashes node app after writing first json file
I'm trying to crawl several web pages to check broken links and writing the results of the links to a json files, however, after the first file is completed the app crashes with no error popping up...
...
0
votes
0
answers
59
views
Add both settimeout and timeout to in the array loop
I am looping the array using bluebird map method and then using each row as a payload to my apicall function. Everything works perfectly but I want to incorporate timeout method when response from the ...
0
votes
1
answer
174
views
Looking for Bluebird promise function "any" as series
I have a requirement to run Promise.any in series.
As it's not available (Am I right?) I wrote a function to execute promises in series (with help of Pomise.mapSeries) and resolves at first test ...
-1
votes
1
answer
205
views
Using Cypress.Promise to get list values in test for comparisons and searches
My question I know ahead of time may not be a "best practice" but I promise you I won't understand the "best practice" until I can implement the question at hand and then ...
0
votes
1
answer
2k
views
Rate limit/throttle for axios requests issue
In this class, the get(item) method returns a promise with the response data object that is obtained from the axios call
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
...
0
votes
0
answers
252
views
NodeJS - image conversion in base 64 results inverted collors using pdf-image, bluebird, hi-base64, gm and image-magic
I have this code bellow its receive an base64 pdf and convert to jpg image in base64 too...Its runs in master environment but in dev the generated picture came with inverted collors (like negative ...
0
votes
0
answers
81
views
Streams interrupts at the wrong time NodeJS when downloading multiple images
I am trying to write to disk multiple images concurrently in NodeJS, wait for them all to be done and then continue with the execution of my program.
Here is my code :
const Router = require('express-...
0
votes
1
answer
271
views
Received an unhandled rejection error every time I save something to my database
I keep getting this error whenever I save something to the database. Regardless if its numbers, text ect, it happens and I have no idea why. Two months prior everything worked fine and every time I ...
0
votes
1
answer
189
views
how to convert Async.js parallel to Bluebird
With async.js i can be able to define promises(i know its only functions) with handlers and its give me polymorphism with different handlers also results are seperated.
Can i do this in bluebird ?
...
2
votes
1
answer
101
views
Intentionally not returning Bluebird Promise
I have the piece of code below. Want to call the callback which may return a promise. Resolve it. In case if the promise failed, log it. The caller should NOT know about all this and should return ...
0
votes
0
answers
106
views
bluebird.js await Promise.all(); a promise was created in a handler warning
What's the proper way to async-await multiple promises I wish to all start at the same time. I'm doing await Promise.all(...), but...
I'm getting an annoying warning:
Warning: a promise was created ...
0
votes
1
answer
107
views
Iteratee function loses reference to this object in javascript if used with bluebird map function
I am using bluebird npm package for handling asynchronous workloads in my application. Lets assume that processAllItems function is used to trigger processing of all the items. Each one of the items ...
0
votes
1
answer
340
views
Chain of endpoints in Node and Express: how to prevent that some of them stops all the series?
In some page I have to get information from 8 different endpoints. 2 of them are outside of my application and sometimes they cause an delay at displaying data. The web browser waits until the data is ...
-1
votes
1
answer
296
views
React frontend doesn't receive return from nodejs backend in Reactjs + Nodejs App
My backend login process is running on a Nodejs 12.16.1. The code is following:
router.post("/elogin", async (req, res) => {
try {
if (!req.body.userName || !req.body.password) throw ...
0
votes
1
answer
90
views
Import bluebird on quasar
I am using bluebird.js and Quasar Framework. I would like to use it globally and previously configure it like
import { Promise } from 'bluebird';
Promise.config({
cancellation: true });
But I'...
0
votes
0
answers
215
views
Repeat a Promise until an array is a certain length?
In an effort to improve the speed when constructing an Array to send to the client-side, the number of results are being paginated on the client-side and thus reduced on the server-side.
Calling an ...
0
votes
0
answers
42
views
MongoDB/Mongoose query returns []: Importing (but not using) Bluebird fixes it
I have a MERN stack web app, and when I did a basic GET request w/ Axios to find() all entries in a MongoDB instance (via router, controller, models), it returned an empty array. Loading localhost:...
1
vote
1
answer
2k
views
Warning: a promise was rejected with a non-error: [object GeolocationPositionError]
While trying to get the geolocation from the user's browser, if the user has denied permission or blocked the browser from sharing the location we get a console warning from Bluebird that says: ...
1
vote
1
answer
309
views
Bluebird Promise each: continue iteration if promise rejected
According to Bluebird promise online documentation, the "each-method"
(LINK) stops iteration if one promise is rejected. Is there any way to make it continue and complete all iterations?
If not, ...
0
votes
1
answer
122
views
Bluebird Promises: sequential asynchronous execution of chained promises with for-loops inside
To avoid callback hell, I am chaining several (Bluebird Promise) instructions, each running an asynchronous for loop. Instead of waiting for each for loop to finish, the chain rushes right to the end ...
0
votes
1
answer
330
views
Node.js Promise without returning it
I have a use case to resolve a Promise without returning it. Catching for errors internally, but don't want the caller to wait for the promise to resolve.
doSomething()
{
Promise.resolve()
...
0
votes
1
answer
517
views
Promise.try without bluebird
I am trying to re-create bluebird's promise.try function, is this essentially the same?
function promiseTry(callback) {
let error;
let value;
try {
value = callback();
} catch (e) {
...
1
vote
2
answers
132
views
Problem with passing context in Bluebird Promise chain
I faced with situation where I need to pass some values to Promise handler. Below is example of situation
function promiseFunct(x){
return new Promise(function(resolve, reject){
if(x>0) ...
0
votes
0
answers
26
views
How to promisify existing callbacks without async await [duplicate]
I have some controllers where many callback functions are used instead of async await. I am using bluebird promise library to promisify. In callback function there are many mongoose methods like find, ...
0
votes
2
answers
348
views
Is it necessary to put async in bluebird promises
I am trying to add bluebird promises in the project. I am using NodeJS, Express, Mongodb. This is my sample model file
const mongoose = require('mongoose')
// Blue Bird
mongoose.Promise = ...
0
votes
1
answer
186
views
Refactor code with promises to read files and convert them to json
I'm trying to do the following: Read the content of a directory to find all the .xml files (I'm using glob but I'd like to use something like fs.readdir from fs), then I want to read every file using ...
0
votes
1
answer
144
views
Using bluebird promise not working in my created example
I have been studying and trying to understand Asynchronous javascript. After much reading and a suggestion to use the bluebird library because I'm using IE11, I tried it on a simple example I created ...
0
votes
1
answer
2k
views
Is it better to place promises on the front end or back end? [closed]
I'm currently in the process of refactoring my code since there are some load time issues that are preventing my data from being loaded properly on production.
Just to establish a better habit, ...
3
votes
1
answer
72
views
write a while loop using promises using return values within the next promise
I have read all the questions on SO about this subject but I'm still stuck because the condition function in promiseWhile does not take a parameter.
My use case is the following. I am trying to query ...
1
vote
1
answer
209
views
How to fix "Undefined response in pagination" with Bluebird promises (@google-cloud)
I spent quite awhile troubleshooting this and finally found that @google-cloud pagination seems to break when using bluebird promises. It works if I disable bluebird, but since the project makes ...
0
votes
1
answer
571
views
Bluebird Promises.map .then() : not working
I'm using bluebird Promise.map for concurrent downloads
this is the download function
async function concuDownload2(nultUrls) {
Promise.map(nultUrls, nult => new Promise((resolve, reject) =...