angular - Function calls are not supported -


i using @angular: 4.3.6 @angular/cdk: 2.0.0-beta.10 @angular/material: 2.0.0-beta.10 @angular/cli: "^1.4.1

and getting below error whenever try ng serve.

error in error: error encountered resolving symbol values statically.  function calls not supported. consider replacing function or lambda reference exported function (position 194:50 in original .ts file),  resolving symbol ngmodule in d:/projects/webclient/node_modules/@angular/core/core.d.ts,  resolving symbol coremodule in d:/projects/webclient/src/core/core.module.ts,  resolving symbol coremodule in d:/projects/webclient/src/core/core.module.ts 

i don't have lambda functions used or exported in below coremodule.

import { browsermodule } '@angular/platform-browser'; import { commonmodule } '@angular/common'; import { ngmodule, inject } '@angular/core'; import { httpmodule } '@angular/http'; import { routermodule } '@angular/router'; import { browseranimationsmodule } '@angular/platform-browser/animations';  import { ngreduxmodule, ngredux } '@angular-redux/store'; import { applymiddleware, store, combinereducers, compose, createstore } 'redux'; import { createlogger } 'redux-logger';  import { sharedmodule } 'shared/shared.module';  import { routes } './core.routes';  import { store_provider, iappstate } 'core/models/store'; import * r 'core/reducers'; import * c './components'; import * v './views'; import * s './services'; import { menuaction, menugroup, menuitem } 'core/models';  @ngmodule({   imports: [     browsermodule,     commonmodule,     httpmodule,     routermodule.forroot(routes),     browseranimationsmodule,     ngreduxmodule,     sharedmodule   ],   declarations: [     c.appbarcomponent,     v.appcomponent,     v.settingscomponent   ],   providers: [     { provide: store_provider, usevalue: r.sidebar, multi: true },     { provide: store_provider, usevalue: r.actionbar, multi: true },     { provide: store_provider, usevalue: r.tabs, multi: true },     s.actionbarservice,     s.sidebarservice,     s.tabsservice,   ] }) export class coremodule {   constructor( @inject(store_provider) storeproviders: any[], ngredux: ngredux<{}>,     actionbarservice: s.actionbarservice, sidebarservice: s.sidebarservice) {     ngredux.configurestore(r.generaterootreducer(storeproviders), {}, [createlogger()]);   } } 

so issue tsconfig misconfiguration. in main module importing coremodule using absolute path (i.e. root/core/core.module instead of ../core/core.module). missing baseurl tsconfig.app.json file.

i don't understand why happening 2 reasons (and please if can explain me):

  1. this not new project , working before.
  2. the tsconfig.app.json extending main tsconfig.json file has proper baseurlset in it.

anyways, hope other people have same issue.


Comments