-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: No available storage method found #722
Comments
Assuming we have similar root causes, I traced the unhandled promise rejection warning to the following: localForage/src/utils/executeTwoCallbacks.js Lines 1 to 11 in f66bb7b
The unhandled promise rejection comes from the promise returned (but ignored) by invoking
I can work around this by instead relying exclusively on the promise, sidestepping the bug in
To fix |
* remove "Network status set to (true|false)" message This was originally added in a bid to track down a now resolved issue, and thus is no longer needed. * work around UnhandledPromiseRejectionWarning errors from localforage See localForage/localForage#722. * fix missing props in tests * skip passing showEmailAddress from ProfilePopver to the Popover bootstrap component * eliminate unneeded warning in getPrefix * fix spurious state in rhs reducer tests * leverage jest-canvas-mock to avoid warnings from the doughnut chart * fail the build on console messages * Revert "skip passing showEmailAddress from ProfilePopver to the Popover bootstrap component" This reverts commit 73b5fcb. * just remove showEmailAddress in the profile popover unit tests * define STORE_REHYDRATION_FAILED locally vs. in mattermost-redux, for now * fix recently broken unit tests
Is this a custom errorMessage? What does this error message mean? My monitoring system caught this error, but I don't know how to reproduce it. |
I want to know when this problem will occur? |
Hey,
Yes this is a custom error message and it is thrown when... No available
storage method is found.
You can reproduce by using private browsing mode and also disabling cookies
and in general turn on all the browser settings that will prevent sites to
store anything locally.
In case you still want to use the same code, even if localforage will not
be able to save anything, you can use the localforage-memoryStorageDriver.
See: https://github.com/localForage/localForage-memoryStorageDriver
…On Fri, Mar 15, 2019, 09:08 小哈husky ***@***.***> wrote:
I want to know when this problem will occur?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#722 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABPF1XNNTygxJe3wZACrcLTo_MZnHRKCks5vW0bigaJpZM4O2ROa>
.
|
@thgreasi
My Sentry system also tracks this issue for a lot of users but I can't understand what they had to do in order to get such error? From my point of view - it's really not that easy to turn off all the storing mechanisms in modern browsers nevertheless I'm getting this issue from users with Chrome, Safari and Firefox, all recent browser versions.
|
I was able to reproduce the issue by manually disabling Cookies in the global Chrome settings https://take.ms/nXAWX |
Same issue here. In my case, some clients probably are using some plugin or addon in firefox that blocks cookies and therefore breaks localforage. For a temporal workaround I added Waiting for a "real" fix though ;-) |
@Chris1234567899 could you share your setup regarding |
@AndrewBogdanovTSS give this a try: import * as localforage from 'localforage';
import * as memoryDriver from 'localforage-driver-memory';
localforage.defineDriver(memoryDriver);
localforage.setDriver(memoryDriver._driver); |
It would be nice to make this error try-catchable. Our current use case is essentially import localforage from 'localforage';
let instance: LocalForage;
try {
instance = localforage.createInstance({ ... });
} catch (error) { ... } However with this setup, the above error can't be caught. |
@salidean what do you think about such strategy?
I want to fallback to memoryDriver only when all others aren't available |
The error is still valid for SSR :( |
I've encountered this issue during unit tests that depend upon
For the life of me I cannot find where the code is throwing, but I have a feeling the error is uncatchable without modifying the |
Just to second @beshkenadze as I still have the issue after implementing the proposal from @AndrewBogdanovTSS on my Next js app. |
@BernardA have you found any solution. What workaround did you try out? |
@waleedarshad This was many moons ago. I can't recall at all. Sorry. |
@waleedarshad you have to disable a persist reducer for the server-side rendering, something like that:
|
I hit this issue when using aws amplify datastore. At one point I scoured their code and found that the root cause was that jsdom does not provide |
I'm using nextjs, and I'm getting the same error. But I found out that it was caused by a timed task using localforage while running on the server side. Once I disabled the timer from running on the server side, the error went away. |
you can define a custom driver like
|
wow, thanks @sherl0cks. |
Hi! Does this mean is an issue between localforage and SSR? Can you expand ? The only way I can reproduce this is by blocking site data storing from the browser, but seeing so many issues I don't think that many users disabled it. Is there another reason this could be happening? Thank you! |
The error is still valid for window chrome V123.0.6312.59(64bit) :( |
I am still getting an error :
(node:12884) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): Error: No available storage method found.
I'm usingv1.50
Update: The error actually only occurs when using react-snapshot lib
The text was updated successfully, but these errors were encountered: