-
Notifications
You must be signed in to change notification settings - Fork 29
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
ReferenceError: btoa is not defined #11
Comments
First, thanks for the report, glad to have a chance to fix this. I'm looking at the code, and it seems to me that there's code at the top of the switch statement that provides a good answer. If I make the change are you in a position to test that it works. That is, can you call it again with the "bad arguments"? |
Yes, let me know how I can help. I'm using your library to make calls to the Odoo API and I believe the call that is creating the problem goes something like this: xmlrpc.client(
"url",
"execute_kw",
[
"db_string",
parseInt("uid_string"),
"pass_string",
"odoo_model",
"search_read",
[[[ "id", "=", undefined ]]],
],
"xml",
callback
); If I check my args before I make the call–specifically, if I don't pass an undefined–I stop getting the problem. Which I assume is just that the default case is never being reached. |
I fixed getXmlValue -- it should now correctly generate the <base64> encoding in the default case. The new version is 0.4.26. |
Thanks, Dave. I updated and triggered the same conditions and got How does one xmlize An alternative might be to throw a descriptive error when encountering those values. Anyway, thanks for checking this out so quickly. |
I'm using
xmlrpc.client
in Node.js and I found out that I was sometimes calling it with bad arguments which triggered this default case I assume, which threwReferenceError: btoa is not defined
.As far as I'm aware, btoa is not available in Node.js and maybe this would require an alternative solution.
The text was updated successfully, but these errors were encountered: