-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
TypeError: Invalid value used as weak map key #15
Comments
You're probably giving |
This seems to be related to passing Should an |
I think it's best left to the caller. The docs specify input type Object; handling any other type of input gracefully feels like defensive coding which tends to bloat a project. |
I would argue that the error description gives no clue on how to fix this, so in this particular case it would be good to add an |
Instead of throwing an error, I think it would be better to just pass though invalid arguments. Edit: sindresorhus/map-obj#15 would fix this ;) |
Did you try the option do not handle nested objects/arrays yourself, let the lib do it, |
@rameshrr That only works if the top level
|
No idea why, but I was getting this error. Do you know if I'm using some sort of wrong value as a key in object?
ERROR RETURNED TO CLIENT: TypeError: Invalid value used as weak map key
at WeakMap.set (native)
at mapObj (/home/jperelli/celerative/wysh/WYSHAPI/node_modules/map-obj/index.js:23:7)
at module.exports (/home/jperelli/celerative/wysh/WYSHAPI/node_modules/camelcase-keys/index.js:16:9)
at /home/jperelli/celerative/wysh/WYSHAPI/.webpack/service/app/requests/list.js:560:50
at Array.map (native)
at /home/jperelli/celerative/wysh/WYSHAPI/.webpack/service/app/requests/list.js:555:21
at process._tickDomainCallback (internal/process/next_tick.js:129:7)
The text was updated successfully, but these errors were encountered: