request-promise: RP2.0, in browser - Error when importing request-promise as an ES6 module
When I attempt to import request-promise into my web app I get the following error (using Browserify and Babel to transpile):
Cannot find module 'cls-bluebird' from '/Users/Bobby/Documents/Development/mediabase/node_modules/request-promise/lib'
My package.json (snipped) is as follows:
"devDependencies": {
"babel-preset-es2015": "^6.5.0",
"babel-preset-react": "^6.5.0",
"babelify": "^7.2.0",
"browserify": "^13.0.0",
"del": "^2.2.0",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-connect": "^2.3.1",
"gulp-less": "^3.0.5",
"history": "^1.17.0",
"normalize-css": "^2.3.1",
"react": "^0.14.7",
"react-dom": "^0.14.7",
"react-router": "^1.0.3",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
},
"dependencies": {
"express": "^4.13.4",
"request-promise": "2.0.0"
}
Commenting out the request.bindCLS line in the library seems to fix the issue with no adverse affect on request-promise. If I use a standard require() to load the module I get the same issue. Do I need to include cls-bluebird as a dependency ? I thought this was removed …
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 8
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Update dependancy for webpack supprt request-promise to 4.x https://github.com/request/request-promise/issues/91 — committed to adhambadr/node-forecastio by adhambadr 7 years ago
- Work around bug in request-promise, a dependency of openwhisk. This can be removed when the new version of openwhisk is released, which switches from request-promise to needle. References: https://... — committed to epatters/datascienceontology-backend by epatters 7 years ago
- Work around bug in request-promise, a dependency of openwhisk. This can be removed when the new version of openwhisk is released, which switches from request-promise to needle. References: https://... — committed to epatters/datascienceontology-backend by epatters 7 years ago
- Work around bug in request-promise, a dependency of openwhisk. This can be removed when the new version of openwhisk is released, which switches from request-promise to needle. References: https://... — committed to epatters/datascienceontology-backend by epatters 7 years ago
Thanks @fotinakis !
I will remove
cls-bluebirdwith the next release in a few weeks. (And there will be an alternative way for those who actually needcls-bluebird.)Hey buddies, I just released
request-promise@4.0.0that dropped the wholecls-bluebirdpart. You should have no issues with webpack and browserify anymore.Thanks everyone for providing workarounds until now.
@nathanph Thanks for the info!
Well, having the cls-bluebird dependency obviously turned out to be a pita to begin with. I am currently working on the next version of Request-Promise. In this version cls-bluebird will be dropped altogether. So imho it is best to wait for this version rather than trying to find a better fix for the existing mess… 😉
Hi thanks for the updates:
For the benefit of others using Browserify the
ignoreMissing/ignore-missingflag did the trick for me as a temporary workaround.Alternatively: