question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[AOT] ngc: 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, resolving symbol AppModule

See original GitHub issue

Hi! I recently upgraded to the 2.0.0 release version of Angular 2. I’m getting this error from ngc:

ngc: 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, resolving symbol AppModule

I believe it has to do with this code in the NgModule definition:

StoreModule.provideStore(
        compose(
            localStorageSync(['todos']),
            combineReducers
        )({todos, visibilityFilter})

if I change it to this…

StoreModule.provideStore({todos, visibilityFilter})

it works fine. If I attempt to do what the error says, and replace the function with a reference to an exported function it still does not work:

import { Store, StoreModule } from '@ngrx/store';
import { todos, visibilityFilter } from './reducers';
import { NgModule } from '@angular/core'

export const reducers = compose(
            localStorageSync(['todos']),
            combineReducers
        )({todos, visibilityFilter});

@NgModule({
  imports: [
    BrowserModule,
    StoreModule.provideStore(reducers)
  ]
})
export class MyAppModule {}

Do you have any ideas?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
jasonwaterscommented, Oct 14, 2016

Never mind, here’s how the ngrx example app works around it:

https://github.com/ngrx/example-app/blob/master/src/app/reducers/index.ts#L82

3reactions
jasonwaterscommented, Dec 15, 2016

@mxii oh, right. actually my productionReducer and developmentReducer look like this:

const developmentReducer: ActionReducer<State<any>> = compose(
	storeFreeze,
	localStorageSync(['reducerName1', 'reducerName2'], true),
	storeLogger({
		level: 'info',
		collapsed: true,
	}),
	combineReducers)(reducers);

const productionReducer: ActionReducer<State<any>> = compose(
	localStorageSync(['reducerName1', 'reducerName2'], true),
	combineReducers)(reducers);

hope it helps

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR in Error encountered resolving symbol values ...
Calling function 'PerfectScrollbarModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function ...
Read more >
Error encountered resolving symbol values statically. Function ...
Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda? Ask Question.
Read more >
Do you know how Angular transforms your code? - Medium
Error : Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to ......
Read more >
Ngc error due to resolving symbol values statically (rc0)
The error is coming from the use of IonicModule.ForRoot it seems. As a result, I'm not sure where to go from here. Can...
Read more >
AOT metadata errors - Angular
Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function. The compiler does not currently...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found