Bluebird Always Defaults to Debug Config w/ Webpack
See original GitHub issue-
What version of bluebird is the issue happening on? Bluebird 3.5.1
-
What platform and version? Windows 10 64-bit Node v6.11.1 NPM 3.10.10
-
Did this issue happen with earlier version of bluebird? At least as early as 3.4.x
When using Bluebird with Webpack 2.x/3.x, the JavaScript pulled in always comes from node_modules/bluebird/js/browser/bluebird.js
. This originates from:
https://github.com/petkaantonov/bluebird/blob/0da7d15c7241857fc2b853393fb8dd1ab3bbd5d7/src/debuggability.js#L21
But in bluebird’s unminified JS __DEBUG__
was replaced with a true
when it was built. As a result, debugging
will always default to true
consequently enabling longStackTraces
and other options which may be undesired by the developer.
A workaround for the problem is to explicitly pass debug options via Promise.config()
, however if the developer does not specify all relevant options then they will all be enabled by default. A second workaround is to set the BLUEBIRD_DEBUG
environment variable to 0
. Both of these solutions contradict the defaults specified in the Bluebird API docs: http://bluebirdjs.com/docs/api/promise.config.html#promise.config
Created a repo to demonstrate: https://github.com/Cleod9/minimal-bluebird-webpack-debug-issue
Issue Analytics
- State:
- Created 6 years ago
- Comments:21 (5 by maintainers)
Also updated http://bluebirdjs.com/docs/api/promise.config.html#promise.config
The documentation update is much appreciated, thanks for the follow up!