Angular-tree-component: Child node not expanding in AOT built version.

Created on 18 May 2017  路  7Comments  路  Source: CirclonGroup/angular-tree-component

Hi,

I tried the latest version (3.6.0) also 3.5.0 but it is giving me void 0 is not a function error, I downgraded to version 3.2.3 which fixes the void 0 issue but in the AOT built version of the application the nodes are not expanding. I tried Actionmapping click to EXPAND but that doesn't work either (so neither the expand icon nor the node itself is not expanding the children) The JIT compilation of the application doesn't have the same issue.

Any help?

Most helpful comment

Hi all, @adamkleingit,

version 3.7.2

When trying to compile for production in AOT, starting webpack bundling, I get this error :

ERROR in ./aot_temp/~/angular-tree-component/dist/components/tree.component.ngfactory.ts
Module build failed: Error: Can't resolve 'loadChildren' in '...\aot_temp\node_modules\angular-tree-component\dist\components' 

@adamkleingit
This is caused by a conflict with https://github.com/shlomiassaf/ng-router-loader/blob/AST/src/Loader.ts#L48 which catches the expression loadChildren: 'loadChildren' in tree-component.ngfactory.ts .

We are opening an issue in ng-router-loader so that they change their regex not to make false positives. https://github.com/shlomiassaf/ng-router-loader/issues/11

Thanks. Regards

All 7 comments

@mgkoko Are you using SystemJS?

I think SystemJs should not be used. Webpack is gaining popularity for angular and its performance is also good. Also with cli tool being used (whish uses webpack) everyone should move to webpack.

@adamkleingit sorry for my late reply. I am using SystemJs in the development version (JIT) but for the live version I am using AOT built https://angular.io/docs/ts/latest/cookbook/aot-compiler.html which is not using SystemJs and the problem is only in AOT built version.

I am not using angular CLI or webpack, I will try those.

Hi all, @adamkleingit,

version 3.7.2

When trying to compile for production in AOT, starting webpack bundling, I get this error :

ERROR in ./aot_temp/~/angular-tree-component/dist/components/tree.component.ngfactory.ts
Module build failed: Error: Can't resolve 'loadChildren' in '...\aot_temp\node_modules\angular-tree-component\dist\components' 

@adamkleingit
This is caused by a conflict with https://github.com/shlomiassaf/ng-router-loader/blob/AST/src/Loader.ts#L48 which catches the expression loadChildren: 'loadChildren' in tree-component.ngfactory.ts .

We are opening an issue in ng-router-loader so that they change their regex not to make false positives. https://github.com/shlomiassaf/ng-router-loader/issues/11

Thanks. Regards

@gRoussac nice catch, I hope they solve it ASAP

I'm having the same error:

ERROR in ./compiled/node_modules/angular-tree-component/dist/components/tree.component.ngfactory.ts
Module build failed: Error: Can't resolve 'loadChildren' in '/home/brasilct/Documents/backoffice-admin/compiled/node_modules/angular-tree-component/dist/components'

How does it solve?

I'm using webpack 3.1.0 and ng-router-loader 2.0.0.

+1 same error in version 3.8.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carmenbranje picture carmenbranje  路  5Comments

thohoh picture thohoh  路  5Comments

Vishnusangam picture Vishnusangam  路  4Comments

BrkCoder picture BrkCoder  路  4Comments

Roman-Simik picture Roman-Simik  路  5Comments