URL format incorrect ReferenceError: URL is not defined (openvidu-node-client)

After upgrading apps based in openvidu to 2.13 version every functionality was working ok, including direct calls to REST API for options allowed only to moderator etc working in my local environment and pointing the node back-end part to the openvidu 2.13.0 server dockerized version. I was able to develop new features using axios etc

Deploying this node back-end in a VM port 5000(the same VM that it’s with MY_URL/dashboard working succesfully) and running the same command I got an error:

Command:
node server.js MY_URL/dashboard MY_SECRET

Error:
URL format incorrect ReferenceError: URL is not defined
at OpenVidu.setHostnameAndPort (/home/ubuntu/server/node_modules/openvidu-node-client/lib/OpenVidu.js:631:13)

Is it expecting a port? Why is not asking that in local environment pointing there?

Any idea? I need to try pointing from another different VM. I supposed that in that case it will work, but why not in the same machine? 443 port is not in conflict and dashboard is correctly running.

Thanks in advance,

Hi @beka.iglesias , do you mean that running your app locally pointing to the same OpenVidu Server works ok, but it does not work deploying in your VM?

Is your App dockerized? If not, are you using the same Node version locally and in your VM?

Regards,
Carlos

I think the problem may be related with this: https://stackoverflow.com/a/60983398 and openvidu-node-client is using new URL(...) in a way that can fail in node versions lower than 10:

This is probably a bug we did not notice in node <= 10.

I’m trying to guess but maybe the version of node in your VM should be greater or equal to 10 to work properly.

1 Like

Thanks for the fast reply. I will check that and give feedback. It’s making sense for me: I have Debian Testing in my computer so my node version is recent. But the VM is with Ubuntu 18.04 and node installed from repositories.

This is probably a bug we did not notice in node <= 10.

It’s exactly that. Upgrading node version is solved this problem with openvidu-node-client.

Thanks!

2 Likes