2017-12-24 31 views
0

redux (ngrx)를 사용하여 응용 프로그램을 만들었습니다. 모든 장치가 dev 모드에서 제대로 작동하지만 프로덕션 빌드에서는 AOT를 사용하고 있습니다.이 오류는 Uncaught TypeError: Cannot convert undefined or null to object으로 여기에 있습니다. 소스는 combineReducers입니다. 이것이 어떻게 해결 될 수 있는지. 수정 여기 nrgx이 AOT 컴파일 오류가 존재Ngrx 문제가 있습니다.

// reducer.ts 

import { DynamicComponent, FieldTypeReducer, FormCreate, FormGroup, FormList, FormTemplates, FormPreview, FormView } from './forms'; 

const reducers = { 
    dynamicComponent: DynamicComponent, 
    fieldType: FieldTypeReducer, 
    formCreate: FormCreate, 
    formGroup: FormGroup, 
    formList: FormList, 
    formTemplates: FormTemplates, 
    formPreview: FormPreview, 
    formView: FormView 
}; 

export default reducers; 


// app.module.ts 
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; 

import { StoreDevtoolsModule } from '@ngrx/store-devtools'; 
import { StoreModule, ActionReducer, MetaReducer } from '@ngrx/store'; 

// Reducer 
import reducers from './reducer'; 


@NgModule({ 
    imports: [ 

    StoreModule.forRoot(reducers), 
    StoreDevtoolsModule.instrument({ 
     maxAge: 25 
    }) 
    ], 
    providers: [], 
    declarations: [ 
    AppComponent 
    ], 
    schemas: [CUSTOM_ELEMENTS_SCHEMA], 
    bootstrap: [AppComponent] 
}) 
export class AppModule { } 

답변