Skip to content

Postgres.js page brakes the layout of the site #240

@DanieleS

Description

@DanieleS

Describe the bug
Hi, I noticed that opening the the Postgres.js page of the doc brakes the layout of the documentation site. The content of the page goes under the sidebar, and the issue is preserved even on page change, until refresh (on a different page)

To Reproduce
Steps to reproduce the behavior:

Expected behavior
The page should looks like all the other

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows, but it applies to MacOS as well
  • Browser: Chrome, Firefox

Additional context
I tried to investigate a bit and it looks like a combination of issues.

The first one is that the page ends with .js. There is an explicit exception on some file extensions to avoid to treat them as html. Because of this, the generated link in the side menu doesn't get the .html extension as the others.
image

But even if this holds true, I wasn't able to reproduce it in local. After a bit more investigation, I tried it to deploy it on vercel, and it looks like that the file resolution of vercel and the local server are different. With vitepress serve, while client side navigation is broken, it serves the correct file anyway, with correct Content-Type, event if it has a .js extension. On vercel, instead, it returns the 404 error page, then the bundle is loaded, and, as we are in a known url, the correct js file for the page is loaded. It then renders the content but, as the layout is wrong, it doesn't take into account for the sidebar and the page looks bugged.

Possible solutions
In the beginning I thought it was a vitepress issue, but I would say that their check is not wrong after all.

We can rename the page to something like postgresjs (getting rid of the dot) or adding a .html manually at the end of the links (I found a couple of them, in .vitepress/config.ts and api/index.md)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions