barbatus / angular2

Angular2 Packaged for Meteor
14 stars 10 forks source link

No errors thrown when trying to use an undefined package #3

Closed sclausen closed 9 years ago

sclausen commented 9 years ago

I'm not exactly sure, if this is an issue for @barbatus angular2 or @Urigo Meteor-Angular2, but If I got it right, this project is responsible for TypeScript compilation.

In a Meteor-Angular2 project, I wanted to use Random.hexString(n); on the server, but overlooked, that I missed to add it to .meteor/packages. I found out, that the script simply stopped to execute after trying to use Random with no error thrown. When using meteor with javascript, this slip causes a ReferenceError: Random is not defined on the server or the client, but with Meteor-Angular2 and TypeScript, errors are only thrown on the client side.

sclausen commented 9 years ago

Same goes for every other error. new Mongo.ObjectId(hexString) should throw an error, if the length of the provided hex-string is not 24 characters long. Besides this, the meteor.d.ts is wrong at the point, that hexString should be optional.

barbatus commented 9 years ago

@sclausen Yes, because modules on the server side being loaded asynchronously, errors were raised not in the main fiber. I just fixed it, please try it out.

sclausen commented 9 years ago

Really nice! Thanks! For the tiny fix in meteor.d.ts I made a pull-request borisyankov/DefinitelyTyped/pull/6072