在构建角8.0.1应用程序时,我会得到这个错误消息。我的环境如下(Ubuntu 18):
我正在按以下方式构建该项目:ng build --base-href /dist/checks-gis-ng/ --prod --named-chunks true --output-hashing none --aot true --build-optimizer true
StoreModule.forRoot(appReducers),
EffectsModule.forRoot(mainEffects),export interface AppState {
authState: AuthState,
routerReducer: fromNgrxRouter.RouterReducerState<routeReducer.RouterStateUrl>;
}
export const appReducers: ActionReducerMap<AppState> = {
authState: authReducer,
routerReducer: fromNgrxRouter.routerReducer
};这段代码来自我的角库。
export interface AuthModuleState {
authState: AuthState;
}
export interface AuthState extends AbstractData {
isLoggedIn: boolean
userData: UserData,
message: String
}
export const initialAuthState: AuthState = {
isLoggedIn : false,
userData : new UserData(),
message: ''
};
export const reducers: ActionReducerMap<AuthModuleState> = {
authState: fromAuthReducer.authReducer,
};
const reducer = createReducer(
initialAuthState,
on(authActions.loginRequest, (state, { data }) => authReducerFunctions.onLoginRequestEvent(state, data)),
on(authActions.loginRequestSuccess, (state, { data }) => authReducerFunctions.onLoginRequestSuccessEvent(state, data)),
on(authActions.loginRequestError, (state, { data }) => authReducerFunctions.onLoginRequestErrorEvent(state, data)),
on(authActions.logoutRequest, (state, { data }) => authReducerFunctions.onLogoutRequestEvent(state, data)),
on(authActions.logoutRequestSuccess, (state, { data }) => authReducerFunctions.onLogoutRequestSuccessEvent(state, data)),
on(authActions.logoutRequestError, (state, { data }) => authReducerFunctions.onLogoutRequestError(state, data)),
on(authActions.signupRequest, (state, { data }) => authReducerFunctions.onSignupRequestEvent(state, data)),
on(authActions.signupRequestSuccess, (state, { data }) => authReducerFunctions.onSignupRequestSuccessEvent(state, data)),
on(authActions.signupRequestError, (state, { data }) => authReducerFunctions.onSignupRequestError(state, data))
);
export function authReducer(state: AuthState | undefined, action: Action) {
return reducer(state, action);
}这是控制台的跟踪:
TypeError: can't convert undefined to object main-es2015.f60865f5f16cd035360b.js:1:1223802
nx http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1
rx http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1
e http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1
reduce self-hosted:354
addFeatures http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1
Ox http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1
n http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1
Si http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1
qi http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1
qi http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1
$i http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1
create http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1
bootstrapModuleFactory http://localhost/dist/checks-gis-ng/main-es2015.f60865f5f16cd035360b.js:1TypeError: can't convert undefined to object main-es2015.f60865f5f16cd035360b.js:1:1223802我必须说我不是Ngrx或Angular方面的专家,所以我认为我做错了什么。如有任何帮助,我们将衷心感谢。
发布于 2019-07-08 07:31:11
对于您提到的依赖项,@ngrx/core应该至少有一个问题。
这是以前ngrx版本中的一个旧包。你得把它移走。
https://stackoverflow.com/questions/56847941
复制相似问题