Wix code bug reporting

I am trying to use the JavaScript function btoa() in a .jws file. I get a function not defined error. Front end code works ok. I think this is because the browser implements the function and the wix JavaScript engine does not. I don’t know if this is a bug or should be made a feature request.

I do know that I have spent much time trying to figure out how to report code bugs and succeeded once. But am unable to find it again. Should have written it down.

So can someone tell me how to report a code bug?
And how to request a code feature?

I tried this myself in a .jws file and it works fine. Perhaps the error is from something else?

Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.

The IDE does not flag an error, it occurs at run time. You can see it in the browser console.
if you can actually execute btoa() properly let me know and I will send a link.

To clarify:

testbtoa.jws:

export function testbtoa(arg) {
return btoa(arg)
}

Page code:

import { testbtoa } from ‘backend/testbtoa’
$w.onReady( function () {
testbtoa(“blah”).then(result => {
console.log(result)
}). catch (err => {
console.log(err)
})
});

Console output when page loads:

ReferenceError: btoa is not defined

Browser console:

@sigpoggy aha - Well…

…it seems that the server side (node.js) does not support a btoa() interface. You might be able to get by with something like this: Buffer(arg, ‘binary’).toString(‘base64’);

You’ll just have to “roll your own.” Also, feel free to post a Feature Request .

@yisrael-wix
It doesn’t have Buffer either. I installed a base64 library file to solve the problem.

1 Like