-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
When using AsyncLocalStorage, "Illegal invocation" error occurs #18
Comments
Thanks for reporting this bug @Venryx ! Based on this and #17, you seem to be using several features that I and others don't and discovering bugs along the way -- thanks for working through these with us 🙂 Hopefully #4 will make these usage bugs happen less often I have never seen this type of error either, but have noticed that some It's good to know that there's a workaround in the meantime for anyone experiencing this, and that also means this isn't as high priority / doesn't need an immediate fix. |
So ironically I actually ran into this while adding tests in #21 😆 😅 . Will push out a new release very soon, especially as this (and #17 too due to addition of a test for it) are actually blocking #21 now, and that blocks #16 . Both #19 and #22 have been tested locally against #21, so can confidently release them now 🙂 |
Fix has been released in v0.1.2 |
My config is pretty simple:
Yet I get this error:
Googled it, and it appears to be the same issue here: https://stackoverflow.com/questions/41126149/using-a-shortcut-function-gives-me-a-illegal-invocation-error
To fix, you can either bind the
getItem
/setItem
functions to the localStorage object, or do the equivalent by using a(...args)=>localStorage.XXX(...args)
wrapper function.For now I am fixing it by globally applying the bind:
However, the library should not require the developer to apply this global binding.
The text was updated successfully, but these errors were encountered: