[solved] Javascript error in the Chrome when the site url is defined as ip address


On the Chrome Mattermost refuses to load, because there is: “Uncaught TypeError: Failed to construct ‘URL’: Invalid URL”. The problematic line is in the main.js: if(t.SiteURL)return new URL(t.SiteURL).pathname; The Mattermost is hidden behind the Apache proxy. After changing the main.js, so there would be alpha chars in the SiteURL that’s passed into the URL() Mattermost started to work as intended.

Steps to reproduce

  1. Cofigure Mattermost to work on ip address
  2. Hide it behind the proxy and set it to work as /directory (I can’t tell if that’s necessary)
  3. Use Chrome

Expected behavior

Chrome should display normal login window and then allow people to send messages, jump from room to room, etc.

Observed behavior

In the Chrome there is only gray screen and in the js console there is as error: “Uncaught TypeError: Failed to construct ‘URL’: Invalid URL” pointing out to the main.js file.

Never mind, I’ve found the problem. The guy that was setting the system missed the dot in the ip address. Looks like that Chrome is more strict with the urls than Firefox.