cypress-io / cypress-documentation

Cypress Documentation for the Cypress App, API, Cypress Cloud, UI Coverage and Cypress Accessibility.
https://docs.cypress.io
MIT License
955 stars 1.05k forks source link

Some redirects are failing #3637

Closed amirrustam closed 3 years ago

amirrustam commented 3 years ago

I'm submitting a...

[x] Bug report
[ ] Content update
[ ] Process update (build, deployment, ... )

Current Behavior

Current router redirects in Nuxt config:

router: {
    trailingSlash: false,
    extendRoutes(routes, resolve) {
      routes.push(
        {
          path: '/',
          redirect: '/guides/overview/why-cypress',
        },
        {
          path: '/guides',
          redirect: '/guides/overview/why-cypress',
        },
        {
          path: '/plugins',
          redirect: '/plugins/directory',
        },
        {
          path: '/guides/dashboard/dashboard-introduction',
          redirect: '/guides/dashboard/introduction',
        }
      )
    },
  },

The issue persists for redirects added in https://github.com/cypress-io/cypress-documentation/pull/3610/commits/559dd988985ec67f60353a2ca30934b63e3b471a as well.

amirrustam commented 3 years ago

@matthamil I don't want this to be a blocker for launch, so if we don't resolve it by release time we can temporarily rely on Cloudflare page rules to handle the redirects.

amirrustam commented 3 years ago

I tried fixing this by building a custom redirector via a router middleware, but it seems the router middleware get removed when doing nuxt generate....which makes sense.