Repository navigation
fix(render): make LibreOffice rendering and file:// images work on Windows - #32
Merged
Merged
Conversation
…ndows Every LibreOffice render failed on Windows: Bun.spawn can't launch soffice.com, the path both `where soffice` and our fallbacks returned. With that fixed, soffice then hung on the file://C:\... profile URL, so the URL now comes from pathToFileURL. The engine also gets a 150s cap, matching Word for Windows, so a stuck soffice fails rather than blocking forever. file:///C:/x.png became /C:/x.png, and %20 stayed literal on every platform. Host-less file URLs now convert properly. One with a host keeps its old meaning, since converting it on Windows would make a UNC path out of an attacker-influenced --image. render.test.ts now asks the engine whether LibreOffice is available, instead of spawning /bin/sh, which crashed the whole file on Windows. A new windows-render CI job keeps all of this covered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docx can't fix this itself: on a Windows runner, PowerShell kept decoding as IBM437 even after the child process called SetConsoleOutputCP(65001), and the child still saw 65001, so it can't detect the mismatch either. Setting the encoding in PowerShell does fix it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
@xsvm one request and one heads-up, since you have Word on real Windows and our CI runners don't. Could you try these with a binary built from this branch? Word on Windows has never been run by us, and
Just reporting what you see is plenty; no need to change anything. Heads-up on #26: three commits ( 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Running real commands on GitHub's Windows runners found two bugs. This fixes them and adds CI so they stay fixed. It's independent of #26.
renderfailed withExecutable not foundBun.spawncan't launchsoffice.com, whichwhere sofficelists first and our fallbacks namedsoffice.exesofficehungfile://C:\...isn't a valid profile URLpathToFileURL--image file:///C:/x.pngwasn't found/C:/x.pngfileURLToPathAlso:
soffice. The timeout path itself hasn't been run.%20in afile://URL now decodes on every platform.file://URL with a host keeps its old meaning. On Windows, converting it would produce a UNC path from an attacker-influenced--image.render.test.tsasks the engine whether LibreOffice is available instead of spawning/bin/sh, which crashed the whole file on Windows.windows-renderCI job: installs LibreOffice, runs the render and image tests, then renders with the compiled binary.Test plan
bun run checkand the fullbun teston macOSwindows-renderon this PR🤖 Generated with Claude Code