question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Promise.all is not a function

See original GitHub issue

I receive this error on Chrome 49.0.2623.87. I have es6-promise 3.2.1. I am packaging using webpack. Testing using the webpack development server. es6-promise is being included in webpack as a plugin:

plugins: [
    new webpack.ProvidePlugin({
        "Promise": "es6-promise",
        "fetch": "imports?this=>global!exports?global.fetch!whatwg-fetch"
    })
]

The call in my code (TypeScript) looks like:

            return Promise.all(<Promise<any>[]> [CartService.find(), CatalogService.find()]);

CartService.find() and CatalogService.find() both return Promises.

When my code runs I receive the error:

Uncaught (in promise) TypeError: Promise.all is not a function

Looking at the JS sent to the browser I can see that this library is included in the bundled code.

If I comment out the line in my webpack.config.js file then it runs fine (but there is obviously no polyfill).

What am I doing wrong?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
stefanpennercommented, May 18, 2016

@Sinewyk any recommendations for improving this for this project?

0reactions
Sinewykcommented, May 19, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Promise.all is not a function · Issue #5687 · nodejs/node - GitHub
The message is correct here. Promise.all is trying to call promise1[Symbol.iterator]() which is exactly what it's supposed to do, only to find ...
Read more >
Promise.all() - JavaScript - MDN Web Docs
The Promise.all() method takes an iterable of promises as input and returns a single Promise . This returned promise fulfills when all of ......
Read more >
Promise.all raises TypeError: undefined is not a function
The reason is that Promise.all expects an iterable . You are only returning 1 promise. Look: enter image description here.
Read more >
JavaScript | Promise.all() Method - GeeksforGeeks
Here, Promise. all() method is the order of the maintained promises. The first promise in the array will get resolved to the first...
Read more >
How to use JavaScript Promise.all with real-life code example
In this post, we will dissect how JavaScript Promise.all function works visually and with a real-life code example, let's get started!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found