iotaledger / iota-wiki

IOTA Wiki
https://wiki.iota.org
Other
117 stars 282 forks source link

Switching network from a not found page leads to a 404 url #806

Open begonaalvarezd opened 1 year ago

begonaalvarezd commented 1 year ago

Describe the bug

There seems to be a bug with the network switcher urls:

If you are in eg https://wiki.iota.org/shimmer/lola and you switch the network, you will not go to eg https://wiki.iota.org/next/lola, but to https://wiki.iota.org/next/404

To Reproduce Steps to reproduce the behavior:

  1. Go to https://wiki.iota.org/shimmer/lola
  2. Switch to network to next
  3. You landed in https://wiki.iota.org/next/404 instead of https://wiki.iota.org/next/lola

Expected behavior You should have landed in https://wiki.iota.org/next/lola

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

jlvandenhout commented 1 year ago

I can confirm there is a bug. The switcher appends the target path wrongly, in the example resulting in https://wiki.iota.org/shimmer/shimmer/lola and https://wiki.iota.org/next/shimmer/lola (note the double shimmer and next/shimmer). I'll have a look tonight.

jlvandenhout commented 1 year ago

Seems like the above is resolved in the new Wiki deploy. On mobile the correct path is given for each dropdown item in the switcher. Only on desktop the links have 404 in them.

jlvandenhout commented 1 year ago

I can't seem to reproduce this on a local Wiki build. There the paths are correct. Could this have something to do with the way Vercel routes requests that result in a 404 status?

begonaalvarezd commented 1 year ago

I can't seem to reproduce this on a local Wiki build. There the paths are correct. Could this have something to do with the way Vercel routes requests that result in a 404 status?

I got to know about this bug before we did the vercel migration, it already happened before in production when the wiki was in GH Pages, so it must be unrelated to that.

Its true that is not reproduceable in localhost, only on a deploy, so my guess is that it is related to the docusaurus tool used to get the path, because if you inspect the DOM the 404 link is in the DOM directly, but its only a guess, I havent really debugged it yet

image

VmMad commented 1 year ago

I've noticed a similar issue on other wikis, like this one: https://verdaccio.org/example. When attempting to switch languages, it redirects to a 404 page instead. This seems like it might be an issue with Docusaurus during the production build. I've opened a discussion about it on their GitHub.