Home > Back-end >  A hash ("#") gets appended to my URL on load
A hash ("#") gets appended to my URL on load

Time:11-08

I'm working on a rather large legacy web app with the following stack: nginx, Django, React with React Router.

My problem is that any URL that I load gets a # appended to one before end if the last char is a /.

So https://dev.local/feed/ becomes https://dev.local/feed/#/,

and https://dev.local/create/?fid=user8:13/ becomes https://dev.local/create/?fid=user8:13#/.

I've investigated everything on the front end side. I'm using browserRouter, not hashRouter. I only have one router in my front end. I suspect this is coming from the back end, but not ruling out the front end. Edit: tried completely commenting out the router - the problem persists.

My question is how do I generally approach debug something like this? Browser debug tools - console, network, etc are not showing any redirects or URL rewrites. What would work here?

CodePudding user response:

The issue disappeared after I ripped out a large node module with a lot of subdependancies (old version of spectacle). The list of subdependencies is quite extensive, and it's hard to pinpoint what solved the problem. Nothing obvious could be seen, like multiple version of react-router or history modules.

  • Related