clbond / ng2-redux-form

Connect Angular 2 forms to Redux stores
17 stars 7 forks source link

@angular/compiler-cli error: Error encountered resolving symbol values statically. Function calls are not supported #16

Closed Redigast13 closed 7 years ago

Redigast13 commented 7 years ago

I use @angular/compiler-cli for Ahead-of-Time compilation and internalization. I run "node_modules/.bin/ngc" -p tsconfig-aot.json for Ahead-of-Time compilation and I get an error:

Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an
exported function (position 26:35 in the original .ts file), resolving symbol NgReduxForms in d:/web/sites/zen-cms-client2/node_modules/ng2-redux-form/source/module.ts
    at simplifyInContext (d:\web\sites\zen-cms-client2\node_modules\@angular\compiler-cli\src\static_reflector.js:470:23)
    at StaticReflector.simplify (d:\web\sites\zen-cms-client2\node_modules\@angular\compiler-cli\src\static_reflector.js:473:22)
    at StaticReflector.annotations (d:\web\sites\zen-cms-client2\node_modules\@angular\compiler-cli\src\static_reflector.js:60:36)
    at NgModuleResolver.resolve (d:\web\sites\zen-cms-client2\node_modules\@angular\compiler\bundles\compiler.umd.js:14050:46)
    at CompileMetadataResolver.getNgModuleMetadata (d:\web\sites\zen-cms-client2\node_modules\@angular\compiler\bundles\compiler.umd.js:14296:49)
    at d:\web\sites\zen-cms-client2\node_modules\@angular\compiler\bundles\compiler.umd.js:13284:43
    at Array.forEach (native)
    at _extractModulesAndPipesOrDirectives (d:\web\sites\zen-cms-client2\node_modules\@angular\compiler\bundles\compiler.umd.js:13283:28)
    at analyzeNgModules (d:\web\sites\zen-cms-client2\node_modules\@angular\compiler\bundles\compiler.umd.js:13039:16)
    at OfflineCompiler.compileModules (d:\web\sites\zen-cms-client2\node_modules\@angular\compiler\bundles\compiler.umd.js:13115:20)
Compilation failed

When I run "./node_modules/.bin/ng-xi18n" for creating internalization files I got almost the same error:

Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an
exported function (position 26:35 in the original .ts file), resolving symbol NgReduxForms in d:/web/myapp/node_modules/ng2-redux-form/source/module.ts
    at simplifyInContext (d:\web\myapp\node_modules\@angular\compiler-cli\src\static_reflector.js:470:23)
    at StaticReflector.simplify (d:\web\myapp\node_modules\@angular\compiler-cli\src\static_reflector.js:473:22)
    at StaticReflector.annotations (d:\web\myapp\node_modules\@angular\compiler-cli\src\static_reflector.js:60:36)
    at NgModuleResolver.resolve (d:\web\myapp\node_modules\@angular\compiler\bundles\compiler.umd.js:14050:46)
    at CompileMetadataResolver.getNgModuleMetadata (d:\web\myapp\node_modules\@angular\compiler\bundles\compiler.umd.js:14296:49)
    at d:\web\myapp\node_modules\@angular\compiler\bundles\compiler.umd.js:13284:43
    at Array.forEach (native)
    at _extractModulesAndPipesOrDirectives (d:\web\myapp\node_modules\@angular\compiler\bundles\compiler.umd.js:13283:28)
    at Object.analyzeNgModules (d:\web\myapp\node_modules\@angular\compiler\bundles\compiler.umd.js:13039:16)
    at Extractor.extract (d:\web\myapp\node_modules\@angular\compiler-cli\src\extractor.js:34:30)
Extraction failed
clbond commented 7 years ago

I have never tested the library with AoT before. I will add this to my todo list and try and get this resolved this week for you. In the meantime if you find a way to fix it it would be great if you could submit a PR!

Redigast13 commented 7 years ago

Here is PR that fixes this issue: https://github.com/clbond/ng2-redux-form/pull/18

clbond commented 7 years ago

Merged your PR. Thank you @Redigast13