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 Polyfill for BlueBird: with Babel 6 is this still a thing?

See original GitHub issue

From what I’ve read about Babel 6 it looks like the runtime is no longer supported. Wondering if the suggested polyfill in the readme is still the correct approach?

require('babel-runtime/core-js/promise').default = require('bluebird');

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

16reactions
jeromecovingtoncommented, Mar 30, 2016

If I prefer to use bluebird as my Promise implementation of choice in Node, rather than the native ES2015 implementation, is there a way to declare this without needing to add the require statement from this issue description in every file that uses Promise?

5reactions
extgcommented, Feb 19, 2017

If you are using babel-plugin-transform-runtime with default configuration, that’s includes polyfill (but don’t export it to the global scope), you can just replace babel-runtime/core-js/promise

plugins: [
  new webpack.NormalModuleReplacementPlugin(/babel-runtime\/core-js\/promise/, 'bluebird')
],
Read more comments on GitHub >

github_iconTop Results From Across the Web

The Six Things You Need To Know About Babel 6
The babel npm package no longer exists. Instead, Babel has been split into multiple packages: babel-cli, which contains the babel command line ...
Read more >
Upgrade to Babel 7
Based on similar thinking, we have removed the polyfill proposals from @babel/polyfill . Right now @babel/polyfill is mostly just an alias of core-js...
Read more >
Babel and Bluebird promise - node.js - Stack Overflow
By default Babel propose Promise polyfill. How can I force it to use Bluebird implementation or disable the polyfill (I use preset es2015)....
Read more >
25. Promises for asynchronous programming - Exploring JS
A Promise is settled if “things are done” (if it is either fulfilled or rejected). A Promise is settled exactly once and then...
Read more >
babel-loader - npm
new webpack.ProvidePlugin({ 'Promise': 'bluebird' }), ...
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