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.

Not available storage fails silently

See original GitHub issue

Hello there 👋 ,

First of all, I really really like zustand as a state management tool and I’m a big fan of it. I just noticed one small thing. When using the persist middleware to add the state to the localStorage or sessionStorage and the application doesn’t allow to access it for example when used in an SSR application, the error or the fact that is not available is not notified to the user or the developer.

This means it fails silently and when you are not checking the storage yourself you might expect it being saved, but it’s not.

I think by adding some warning or information within the console here in the middleware.ts file like this could save some debugging time:

try {
  storage = getStorage()
} catch (e) {
 console.warn("You try to persist your state, but the storage is currently not available in your application")
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
luchopcerracommented, Jan 19, 2021

Ah! What version of zustand are you using? This is something that has been fixed since 3.3.0 (see #275)

Perfect! i was using 3.2.0 so i was behind #275

1reaction
AnatoleLucetcommented, Jan 25, 2021

Ah! What version of zustand are you using? This should be fixed since 3.3.0 (see #275)

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Ways to Fix the "Not Enough Disk Space for Windows 10 ...
But before the installation process starts, Windows checks to ensure there's enough storage space on your internal drive. If there isn't enough ......
Read more >
Mounting fails silently, all of a sudden - Unix Stack Exchange
(mounting points was the one for the disk before it disappeared) there is no error... but, still nothing. Even in df command it...
Read more >
How To Fix "Not Enough Storage Is Available To Process This ...
The easiest fix is to restart the PC and start over again. But, doing so means you lose any ongoing work on your...
Read more >
Error: Not enough storage is available to process this command
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters 3. Locate ; IRPStackSize 4. If this value does not exist Right Click ...
Read more >
How to Fix There is Not Enough Space on the Disk to ...
Fix 1: Rescan Disks in Disk Management · Fix 2: Check Current Partitions · Fix 3: Convert Basic Disk to Dynamic · Fix...
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