I'm submitting a bug report
- Library Version:
0.21.0
- Browser:
Firefox, Edge, IE 11
Current behavior:
An error is thrown if you enable bluebird's cancellation option: cannot enable cancellation after promises are in use. The error doesn't occur in Chrome.
A newly created CLI project has the bluebird configuration in main.js.
Example configuration in main.js that fails at startup:
import environment from './environment';
//Configure Bluebird Promises.
//Note: You may want to use environment-specific configuration.
Promise.config({
warnings: {
wForgottenReturn: false
},
cancellation: true
});
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.feature('resources');
if (environment.debug) {
aurelia.use.developmentLogging();
}
aurelia.start().then(() => aurelia.setRoot());
}
Expected/desired behavior:
A newly setup project should allow any bluebird configuration options without failing.
The aurelia-bootstrapper module seems to be using promises in any other browser than Chrome before main.js is loaded.
One option is to change the bootstrapper, so it doesn't use promises. This will allow us to use the current clean setup, that is easy for people to understand.
Another option, which is our current fix, is to configure bluebird in index.html. Our index file is then changed to:
<!--<script src="dist\vendor-bundle.js" data-main="aurelia-bootstrapper"></script>-->
<script src="dist\vendor-bundle.js"></script>
<script>
requirejs.config({
skipDataMain: true
});
// Configure Bluebird Promises.
Promise.config({
warnings: {
wForgottenReturn: false
},
cancellation: true
});
require(['aurelia-bootstrapper']);
</script>
Note that the requirejs config isn't actually needed, but it still might be a good idea to tell it not to look for data-main.
I'm submitting a bug report
0.21.0
Firefox, Edge, IE 11
Current behavior:
An error is thrown if you enable bluebird's cancellation option:
cannot enable cancellation after promises are in use. The error doesn't occur in Chrome.A newly created CLI project has the bluebird configuration in
main.js.Example configuration in
main.jsthat fails at startup:Expected/desired behavior:
A newly setup project should allow any bluebird configuration options without failing.
The
aurelia-bootstrappermodule seems to be using promises in any other browser than Chrome beforemain.jsis loaded.One option is to change the bootstrapper, so it doesn't use promises. This will allow us to use the current clean setup, that is easy for people to understand.
Another option, which is our current fix, is to configure bluebird in
index.html. Our index file is then changed to:Note that the requirejs config isn't actually needed, but it still might be a good idea to tell it not to look for
data-main.