Skip to content

Beta website basePath and vercel proxy #1590

Closed

Description

@florian-lefebvre

The beta website has a basePath (/new) for monorepo deployment, as explained in development.md.
However, it causes several issues:

  • some links can go to /new in production (for example somewhere in the blog)
  • we can't use the features of next/router
  • telemetry in www/pages/_app.tsx can't as it's based on the router
  • almost all links are broken when developing locally

So I think we should find a better solution. I have an idea but i don't know if it would work.

Couldn't we use the router with Link etc and on routeChangeStart, depending on the node environment, check if the url contains the basePath and remove it in production before pushing any url? It would be some kind of middleware.

Activity

  1. added
    bug
    on May 17, 2021
  2. kiwicopple commented on May 18, 2021

    @kiwicopple
    Member

    Hey @florian-lefebvre - thanks for opening this. The current setup is definitely frustrating. We're using this set up:
    https://vercel.com/blog/monorepos

    Your idea would definitely work, but because it's not getting proxied on the "edge" it would mean that users land on the website, then bounce out to another page. This would be very slow for the end user.

    I would love to have a better set up than what we currently have. Potentially we could remove the /new now (since we have migrated most content over), then only have redirects if the route is prefixed by /docs. This will need testing, so I can leave this open for discussion/implementation

  3. florian-lefebvre commented on May 18, 2021

    @florian-lefebvre
    ContributorAuthor

    I'll made a pull request for that

  4. inian commented on Nov 1, 2021

    @inian
    Member

    we moved to a new setup today which fixes this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions