Home > Software engineering >  window.location not redirecting if address(port) specified is running on another app
window.location not redirecting if address(port) specified is running on another app

Time:01-25

If I run just my frontend app on port 3000, then location.pathname = http://localhost:8082 redirects just fine on a button click to localhost:8082. When I start additional service on another terminal tab on port 8082, my button stops working and just does nothing, no redirecting. If I stop the app on 8082, then button again redirects successfully.

More specifically, when I click button to do redirecting - nothing happens when localhost:8082 is running. When I terminate this process, then the redirection happens straight away even without the button click. Something seems to preventing browser to redirect while 8082 process is running.

It used to work just a couple of days ago and I am just lost on ideas what could be causing this?

Might this be related to my kubernetes setup or vhosts file? This happens on various browsers.

CodePudding user response:

Issue was that I had .../auth/... in the 8082 service's URL instead of correct .../oauth/.... God knows why this prevented from redirecting to a wrong url and instead just did nothing.

  •  Tags:  
  • Related