I'm using ngrx-store-localstorage to persist my store in localstorage in an angular 17 project, using the new standalone method.
this is how i configure my meta reducer:
export function localStorageSyncConfig(): LocalStorageConfig {
return {
keys: ['identity'], // Replace with your actual state key
rehydrate: true,
};
}
export function localStorageSyncReducer(reducer: any): any {
return localStorageSync(localStorageSyncConfig())(reducer);
}
and this is my app.config.ts:
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(routes),
provideClientHydration(),
provideStore(localStorageSyncReducer(IdentityReducer)),
provideEffects([IdentityEffect]),
provideStoreDevtools({
maxAge: 25,
logOnly: !isDevMode(),
autoPause: true,
trace: false,
traceLimit: 75,
}),
],
};
and when i build the project i get this error:

what i'm i missing??
Try adding
checkStorageAvailabilityin the local storage configI think for SSR you are getting this error, since
windowdoes not exist on the server!Github issue
PR changes