Unable to view page loaded in a new tab

PLEASE help us help you by writing a good post!
Hello, My sitename is https://super-cactus-a43acf.netlify.app/
It is an invoice app used to generate invoice for customers. You can view past invoices in a new tab, from the main site. That is, you click on a link to view the past invoice, and you are taken to a new tab, where the past invoice loads.
This is the line of code that does that (Javascript): window.open('/view-invoice', '_blank');

I have hosted this app on vercel, and it works perfectly. However on hosting it on netlify, It works fine as well, Until I get to the part, where I try to view a past invoice, and I am taken to a new tab. Strangely, the new tab appears empty, but that is not all, the url in address tab weirdly begins to get longer, like so: https://super-cactus-a43acf.netlify.app/view-invoice/?/&/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/
For some reason, /~and~/ keeps getting appended to the url https://super-cactus-a43acf.netlify.app/view-invoice/, while the page remains blank, until I have to close the tab myself.

I am at lost as to what is causing that to happen.

How can we check this? Are there some test credentials that we can use?

Use chinecheremubawike@gmail.com and 123456 as password. Thanks a lot.

Two things I see on first pass investigation:

  • your URL having an /&/ and a /?/ in it violate the standards as I understand them - they are only usable for query string parameters in URL’s if not HTML-encoded. I am not surprised to hear this doesn’t work well.
  • I’d be looking through your code for the literal string ~and~ since that seems like it comes from your code and could be related to where the problem pops up.

Alright, Thanks a lot.
Though, I can’t quite place where the ~and~ string is coming, as I did not use it in my code.
I appreciate your efforts to help me.

1 Like

Hi, Have you been able to look into it for a solution?

Nope! We still aren’t looking since we never heard back that you’d removed the /&/ and /?/. Did you do that?

Oh, dear. I did not put that in the URL. It appears on its own when I try to navigate to that page, in addition to the /~and~/.