-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't see errors from angular #1374
Comments
Ok, I couldn't find anywhere in the docs about System.import(path).then(importNext, function(err){
console.warn(path);
console.log(err.originalErr);
importNext();
}) |
What specific error is this? If you can share a replication it would be really useful to understand how SystemJS is obscuring the original message and if there is a better way to pick up the original message in https://github.com/ModuleLoader/es6-module-loader/blob/master/src/wrapper-start.js#L41 to avoid it. |
alright:
|
@pocesar I've completely forgotten how to use Angular here, so can you perhaps suggest how to make the following code give an error that covers your use case? I just tried the following: SystemJS.import('angular').then(function(angular) {
angular.module('myModule', ['not-existing']).
config(function(injectables) {
}).
run(function(injectables) {
});
console.log('done?');
}); but get no errors. |
@guybedford my files are SystemJS modules with anonymous register calls (generated from Typescript). You'd have to wrap the code before trying haha // app/main.js
System.register(['angular', '../modules/base'], function(exports_1, context_1) {
'use strict';
var __moduleName = context_1 && context_1.id;
var angular;
return {
setters:[
function (angular_1) {
angular = angular_1;
},
function (_1) {}],
execute: function() {
angular
.module('Main', [
'Base',
'Client'
]);
angular.bootstrap(document, ['Main']);
}
}
});
// modules/base.js
System.register(['angular'], function(exports_1, context_1) {
'use strict';
var __moduleName = context_1 && context_1.id;
var angular;
return {
setters:[
function (angular_1) {
angular = angular_1;
}],
execute: function() {
angular
.module('Base', [
'NonExistant',
]);
}
}
});
// load.js
System.import('app/main.js').then(console.log.bind(console), function(err){
console.warn(path);
console.log(err);
}) |
Thanks for clarifying. Fixed in ModuleLoader/es-module-loader@07aa567. |
Released in 0.19.34. |
I'm using JSPM, but it's a problem with SystemJS.
I'm doing a refactor on my code to use System output from Typescript, and so far, I'm trying to blindly trying to fix errors that are appearing because SystemJS seems to be swallowing the error message from angular.
load.js is:
How can I see the original exception?
The text was updated successfully, but these errors were encountered: