Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In build 1.0.0-beta.25.5 getting ERROR in Error encountered resolving symbol values statically. Calling function 'combineReducers', #4005

Closed
born2net opened this issue Jan 13, 2017 · 8 comments

Comments

@born2net
Copy link

born2net commented Jan 13, 2017

OS?

Windows 10 64

Versions.

ng 2.4.1

Repro steps.

used: https://github.com/born2net/ng-skeleton

The log given by the failure.

** NG Live Development Server is running on http://localhost:4203. **
Hash: b25c435b0c2bc987720b
Time: 19611ms
chunk    {0} main.bundle.js, main.bundle.map (main) 162 kB {3} [initial] [rendered]
chunk    {1} styles.bundle.js, styles.bundle.map (styles) 337 kB {4} [initial] [rendered]
chunk    {2} scripts.bundle.js, scripts.bundle.map (scripts) 232 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.map (vendor) 6.26 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]

ERROR in Error encountered resolving symbol values statically. Calling function 'combineReducers', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in C:/msweb/ng-skeleton/src/app/app.module.ts, resolving symbol AppModule in C:/msweb/ng-skeleton/src/app/app.module.ts, resolving symbol AppModule in C:/msweb/ng-skeleton/src/app/app.module.ts
webpack: bundle is now VALID.

Mention any other details that might be useful.

This is disconcerting as I was not able to get any cli to work since 1.0.0-beta.21
I really hope we can get more info on how to get cli working as I have 4 projects now and each one fails with diff errors with cli.

also, take note take the error is coming from combineReducers which belongs to the the famous ngrx project

import {StoreModule, combineReducers} from "@ngrx/store";

...

@NgModule({
    declarations: [decelerations],
    imports: [
        BrowserModule,
        FormsModule,
        ReactiveFormsModule,
        Ng2Bs3ModalModule,
        HttpModule,
        StoreModule.provideStore(combineReducers({
            storeData,
            appDb
        }), INITIAL_APPLICATION_STATE),
        EffectsModule.run(AppDbEffects),
        //EffectsModule.run(AnotherEffectService),
        StoreDevtoolsModul
       ...

Angular 2 Kitchen sink: http://ng2.javascriptninja.io
and source@ https://github.com/born2net/Angular-kitchen-sink
Regards,

Sean

@celliott181
Copy link
Contributor

celliott181 commented Jan 13, 2017

  1. Have you ensured any global CLI is at the same version as the local CLI in the project?
  2. Have you performed ng init since upgrading CLI versions?
  3. I'm not sure what "ng 2.4.1" references. It would be useful to know NodeJS, NPM, and Angular-CLI versions as reported by the commands node -v, npm -v, ng -v, and PROJECT_ROOT/node_modules/.bin/ng -v.

@born2net
Copy link
Author

yes installed both local and global.
node: v6.5.0
npm: 3.10.3
ng-cli: latest 1.0.0-beta.25.5
angular: 2.4.1

regards

Sean

@marshall007
Copy link

Possible duplicate of #3854. There appear to be issues when referencing files outside of your project's root directory (this includes nested node_modules dependencies, using npm link, etc).

@born2net
Copy link
Author

finally issue resolved, see:

const reducers = {
    storeData,
    appDb
};

const developmentReducer: ActionReducer<ApplicationState> = compose(storeFreeze, combineReducers)(reducers);
const productionReducer: ActionReducer<ApplicationState> = combineReducers(reducers);

export function appReducer(state: any = INITIAL_APPLICATION_STATE, action: any) {
    return productionReducer(state, action);
    // if (environment.production) {
    //   return productionReducer(state, action);
    // } else {
    //   return developmentReducer(state, action);
    // }
}

@NgModule({
    declarations: [decelerations],
    imports: [
        BrowserModule,
        FormsModule,
        ReactiveFormsModule,
        Ng2Bs3ModalModule,
        HttpModule,
        StoreModule.provideStore(appReducer),
        ...

we really need better docs for this stuff.
had dig deep to get this.

Angular 2 Kitchen sink: http://ng2.javascriptninja.io
and source@ https://github.com/born2net/Angular-kitchen-sink
Regards,

Sean

@beeman
Copy link
Contributor

beeman commented Jan 15, 2017

we really need better docs for this stuff. had dig deep to get this.

This it what PR's are for :)

@born2net
Copy link
Author

tell that to my gray hairs :)

@ciekawy
Copy link

ciekawy commented Nov 9, 2017

as for ngrx here is a solution that looks to be the Angular way to do it: ngrx/platform#306

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants