Nativescript-cli: The Angular AOT flag should not be supported in Preview

Created on 18 Dec 2018  路  3Comments  路  Source: NativeScript/nativescript-cli

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.1.0

To Reproduce
1) tns create ngApp --ng
2) tns preview --bundle --env.aot
3) a runtime exception will be thrown

Expected behavior
The AOT flag should not be valid for the preview command.

bug to-be-checked

All 3 comments

Yeah, but.. why?

@sis0k0, when youpreview an aot Angular application, all Angular dependencies are marked as external. In this way, the Angular modules are used from the Preview app itself which is built without aot.

In other words, we should remove the aot flag support from the preview command because the above-mentioned setup is causing runtime exceptions when searching for the ngfactories of the Angular modules.

@DimitarTachev is this still valid? If I remember correctly, we've added support for AOT with preview?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZMW9 picture ZMW9  路  3Comments

NickIliev picture NickIliev  路  3Comments

Fatme picture Fatme  路  3Comments

farfromrefug picture farfromrefug  路  3Comments

empirebattles picture empirebattles  路  3Comments