Not sure if this is a mermaid-isomorphic issue or a Playwright issue, but I'm encountering a rendering issue that only occurs when deploying my website to fly.io, which runs on Linux in Docker. When I build my website locally on my Mac for production the issue doesn't occur.
Locally:

On Fly (live blog link):

My guess is that Playwright is rendering the font slightly differently than a normal headful browser, so the box sizes it sets for the SVGs end up being incorrect when viewed in a headful browser.
Wondering if you have any ideas for what I should try? Appreciate any insights you have! Further details below.
My website code that uses mermaid-isomorphic (through rehype-mermaid):
https://github.com/TomerAberbach/website/blob/main/src/services/posts/parse/convert.server.ts#L181-L188
My Dockerfile:
https://github.com/TomerAberbach/website/blob/main/Dockerfile
I confirmed that I have all of the necessary Playwright dependencies installed in the container. Playwright will print a warning if you are missing some dependencies, and it stopped printing out warnings once I installed them all. Example deployment log:
https://github.com/TomerAberbach/website/actions/runs/10798633747/job/29952544461
Note that I confirmed the fonts are actually getting loaded in the deployed version. I patched mermaid-isomorphic locally and added some logging. I confirmed that "Kantumruy Pro" is printed out as one of the loaded fonts when the server starts up.
I also tried with and without PLAYWRIGHT_CHROMIUM_USE_HEADLESS_NEW=1 and it didn't make a difference.
Not sure if this is a
mermaid-isomorphicissue or a Playwright issue, but I'm encountering a rendering issue that only occurs when deploying my website to fly.io, which runs on Linux in Docker. When I build my website locally on my Mac for production the issue doesn't occur.Locally:

On Fly (live blog link):

My guess is that Playwright is rendering the font slightly differently than a normal headful browser, so the box sizes it sets for the SVGs end up being incorrect when viewed in a headful browser.
Wondering if you have any ideas for what I should try? Appreciate any insights you have! Further details below.
My website code that uses
mermaid-isomorphic(throughrehype-mermaid):https://github.com/TomerAberbach/website/blob/main/src/services/posts/parse/convert.server.ts#L181-L188
My
Dockerfile:https://github.com/TomerAberbach/website/blob/main/Dockerfile
I confirmed that I have all of the necessary Playwright dependencies installed in the container. Playwright will print a warning if you are missing some dependencies, and it stopped printing out warnings once I installed them all. Example deployment log:
https://github.com/TomerAberbach/website/actions/runs/10798633747/job/29952544461
Note that I confirmed the fonts are actually getting loaded in the deployed version. I patched
mermaid-isomorphiclocally and added some logging. I confirmed that "Kantumruy Pro" is printed out as one of the loaded fonts when the server starts up.I also tried with and without
PLAYWRIGHT_CHROMIUM_USE_HEADLESS_NEW=1and it didn't make a difference.