Prevent Gatsby removes trailing slash

I have a site built with Gatsby wich automatically removes the trailing slash like on this url but this doesn’t happen on localhost.

I tried adding a Js snippet on the layout file to add the slash at the end if it isn’t there and you can see here how it becomes a never-ending cicle of adding and removing the slash.

I’ve checked this topic which is similar but it doesn’t work for me 'cause I already have all the optimization disabled.

There are plugins like these which claim to help.