{"id":19256,"library":"babel-preset-async-to-bluebird","title":"babel-preset-async-to-bluebird","description":"A Babel preset that transforms async functions into Bluebird coroutines using .coroutine(). It is a specialized preset for projects already using Bluebird, providing an alternative to the default regenerator-based async-to-generator transform. This package is in maintenance mode with no recent updates; the current version is 1.1.0 and it works with Babel 6.","status":"maintenance","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/eknkc/babel-preset-async-to-bluebird","tags":["javascript","babel-preset","babel","preset","coroutine","bluebird","async"],"install":[{"cmd":"npm install babel-preset-async-to-bluebird","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-async-to-bluebird","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-async-to-bluebird","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required at runtime for .coroutine()","package":"bluebird","optional":false}],"imports":[{"note":"Babel resolves the full package name automatically; using the full name works but is verbose.","wrong":"In .babelrc: \"presets\": [\"babel-preset-async-to-bluebird\"]","symbol":"async-to-bluebird preset","correct":"In .babelrc: \"presets\": [\"async-to-bluebird\"]"},{"note":"The preset is passed as a string, not imported directly.","wrong":"require('babel-preset-async-to-bluebird').transform(...)","symbol":"require in Node API","correct":"require('babel-core').transform('code', { presets: ['async-to-bluebird'] })"},{"note":"If you prefer to require the preset directly, ensure it is passed as an item in the presets array.","wrong":"","symbol":"require in Node API (explicit)","correct":"const preset = require('babel-preset-async-to-bluebird'); require('babel-core').transform('code', { presets: [preset] })"}],"quickstart":{"code":"// .babelrc\n{\n  \"presets\": [\"async-to-bluebird\"]\n}\n\n// install\n// npm install --save-dev babel-preset-async-to-bluebird babel-preset-env\n\n// src.js\nasync function fetchData() {\n  const res = await fetch('https://api.example.com/data');\n  return res.json();\n}\n\n// Run: npx babel src.js --out-file compiled.js","lang":"javascript","description":"Setup Babel with the async-to-bluebird preset and compile an async function using await."},"warnings":[{"fix":"Upgrade to Babel 7 and use @babel/plugin-transform-async-to-generator or keep Babel 6 if legacy.","message":"Babel 6 is end-of-life. This preset does not support Babel 7+ (unless using @babel/plugin-transform-async-to-generator with regenerator).","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"npm install bluebird","message":"Bluebird must be installed separately as a peer dependency (v3+). If Bluebird is missing, async functions will not be transformed correctly.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Only use this preset if you are committed to Bluebird as a dependency.","message":"This preset replaces native async/await with Bluebird coroutines. If you later remove Bluebird, async functions will break.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add babel-preset-env to your presets array before async-to-bluebird.","message":"The preset does not include any environment-specific transformations (e.g., polyfills for fetch). You need additional presets like babel-preset-env.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install --save-dev babel-preset-async-to-bluebird","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'babel-preset-async-to-bluebird'"},{"fix":"npm install bluebird and ensure it is available at runtime (e.g., require('bluebird')).","cause":"Using async-to-bluebird without having installed or configured Bluebird.","error":"ReferenceError: regeneratorRuntime is not defined"},{"fix":"Check Babel version (should be 6) and ensure presets are listed correctly in .babelrc.","cause":"Misconfigured Babel preset; likely using an outdated Babel version or incorrect preset reference.","error":"TypeError: (0 , _asyncToBluebird) is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}