Search code examples
angularangular2-seed

Deploying Angular2 App, getting unknown non-descriptive error


Getting this error in firebug after angular2 app has been deployed : "TypeError: this._nativeError is undefined" in app.js.

*app.js is the javascript that is created from npm run build.prod.aot (and also npm run build.prod).

App runs fine locally, it only seems to give me problems after I've deployed to a standalone web server. I assume I have a minor typo somewhere, but the error looks pretty generic and I can't find anything conclusive as to what might be the cause.

Has anyone seen this issue before? Or have any idea how to narrow down my search in finding it?

Edit: Using this seed project: https://github.com/mgechev/angular-seed but comments/answers are suggesting that others have had issue despite using other starters


Solution

  • Around line 1604 in the compiler.umd.js I added a console.log to show me the message.

    It is part of the set function of the Object.defineProperty(BaseError.prototype, "message" definition.

    The setter is assigning the message to the _nativeError.message, but _nativeError is undefined and thus, THAT was blowing up, hiding the REAL error message.

    So, I just put a console.log to spit out the message that was being passed in, and it showed me the actual error I had (a template error).

    Therefore, this appears to be a bug in their code.

    Hope that helps.