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.

localStorageSyncAndClean errors

See original GitHub issue

When I use localStorageSync it works fine:

localStorageSync(['auth'], true)

But if I use localStorageSyncAndClean I get errors:

localStorageSyncAndClean(['auth'], true, true)

The error I get is:

Unhandled Promise rejection: Cannot read property 'currentSlot' of undefined ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read property 'currentSlot' of undefined
    at MapSubscriber.project (task.effects.ts:39)
    at MapSubscriber._next (map.js:77)
    at MapSubscriber.Subscriber.next (Subscriber.js:89)
    at State.BehaviorSubject._subscribe (BehaviorSubject.js:28)
    at State.Observable._trySubscribe (Observable.js:57)
    at State.Subject._trySubscribe (Subject.js:97)

Basically this is referring to when I do this:

    @Effect()
    goToSlotAfterChange$ = this.store
        .select(state => state.tasks.currentSlot)
        .map(slot => {
            return slot ?
                go(['/' + slot]) :
                go(['/'])
        });

So, it is saying tasks is null. It seems like it says this because the store was not initialized. So, the problem here is that when I use localStorageSyncAndClean, the store doesn’t appear to be initialized. I am not sure why that is, but I can look further into this later.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jeffwhelpleycommented, May 5, 2017

no problem. I have a workaround for now to just use localStorageSync(['auth'], true, window.localStorage, true)

0reactions
btronconecommented, Jul 24, 2017

Closing 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dealing with localStorage errors - CHRISBERKHOUT.COM
Although localStorage quota errors are known by names such as QuotaExceededError and QUOTA_EXCEEDED_ERR , the only way to write testable, non- ...
Read more >
Handling localStorage errors (such as quota exceeded errors)
Let's say you want to check if localStorage is full before inserting an item: how would you do it? Well, there's only one...
Read more >
Error when saving value to localStorage - Stack Overflow
I'm trying to save and read but when I try to save the value of button in the panel, I get error -...
Read more >
Troubleshooting Harness - Harness.io Docs
Typically, the solution is to clear local storage. Troubleshooting steps. Log out of Harness Manager from all Chrome tabs.
Read more >
Always catch LocalStorage security and quota exceeded errors
Why you should always catch LocalStorage errors, and a cross-browser solution to catch the quota exceeded error.
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