We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
useAtom(undefined)
Invalid value used as weak map key
This should be checked for or caught and re-thrown as a more helpful error message.
To Repro:
const value = useAtom(undefined) -> TypeError: Invalid value used as weak map key
I hit this today and if it weren't for this comment I would have been very struggling for a few hours: #1816 (reply in thread)
One potentially common way people might hit this is if they use nested/split atoms and try to reference a key that doesn't exist.
e.g. objects:
const objectAtom = atom({ a: atom(...) b: atom(...) ) ... const bValue = useAtomValue(useAtomValue(objectAtom)[c])
e.g. lists:
const listAtom = atom([atom(...), atom(...)] ... const thirdValue = useAtomValue(useAtomValue(listAtom)[2])
Related: #2272, #1817, #1177, #1816, #2239, #2273
The text was updated successfully, but these errors were encountered:
cc: @dai-shi I believe you replied to a few of the issues/discussions above.
Sorry, something went wrong.
No branches or pull requests
This should be checked for or caught and re-thrown as a more helpful error message.
To Repro:
I hit this today and if it weren't for this comment I would have been very struggling for a few hours:
#1816 (reply in thread)
One potentially common way people might hit this is if they use nested/split atoms and try to reference a key that doesn't exist.
e.g. objects:
e.g. lists:
Related: #2272, #1817, #1177, #1816, #2239, #2273
The text was updated successfully, but these errors were encountered: