1 of 3

As you can see in the URL, you pass "${encodeURIComponent...}" as a string, not as evaluated value. Your code is probably something like:

url = 'https://friendbot(...)?addr=${encodeURIComponent...}';

but should be like:

url = 'https://friendbot(...)?addr=' + ${encodeURIComponent...};