You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(patchy): a page importing a removed logo fails only at the Vite build, and publish doesn't name the file #596
When a new look revision has no logo, a page that imports patchy/_generated/logo.svg still passes pnpm typecheck (the ambient *.svg module) and patchy publish reports only "Vite build failed. Run pnpm exec vite build…". The #568 notice warns at dev start and refresh, but the publish error itself should name the missing import, and typecheck could catch it.
Found while building the company look (#547). Filed by Claude Fable 5.1 (orchestrator) in Claude Code, running in T3 Code, for Allison.
Category: enhancement Summary: When a repo publish's Vite build fails on an import that can't be resolved, the error names the import and the file that imports it.
Current behavior:
Repo publish runs the Vite single-file build in the builder child process. When that build throws anything other than a Patchy LocalError (such as import_refused or toolchain_unsupported), the child replaces it with Vite build failed. Run \pnpm exec vite build` and fix the single-file build before publishing.Text mode and--jsonboth print only that line, exit 1. The thrown error already holds the answer: Vite 8 wraps Rolldown diagnostics in an aggregate whoseerrors[]entries carry acode, and a missing import is UNRESOLVED_IMPORTwith the message[UNRESOLVED_IMPORT] Could not resolve '../patchy/_generated/logo.svg' in src/main.tsx`, followed by a code frame.
The usual way in is a company look revision with no logo: a page that imports patchy/_generated/logo.svg (as the patchy-look skill tells tier 1 and 2 pages to) passes tsc and then fails here without naming the file. ADR-0004 currently says build failures name the stage and diagnostic command, and that raw tool output stays outside the failure envelope. The maintainer approved a narrow exception for unresolved imports.
Desired behavior:
When the page or server build fails with one or more UNRESOLVED_IMPORT diagnostics, the failure names each missing specifier and its importer, repo-relative. Use the first line of each diagnostic with ANSI escapes stripped, and keep the hint to run pnpm exec vite build. Show at most the first few, then say how many more there are. No code frames, stacks or absolute paths.
Every other failure keeps today's generic message, including PLUGIN_ERROR, config-load throws, config syntax errors and non-Error throws. A plugin's thrown text can contain anything, so it stays out.
Existing LocalError refusals (import_refused, toolchain_unsupported, invalid_manifest) are unchanged. No new code; ADR-0004 allows build failures without one.
Tier 2's server build runs through the same child and gets the same behavior.
ADR-0004's sentence on compiler/build failures states the exception: unresolved imports are named; other raw tool output stays outside the failure envelope.
Key interfaces:
The builder child's stdout reply { ok: false, error, code? }: only the error string changes. The reply is a private protocol across releases, so keep its shape.
The aggregate build error's errors[] entries (code, message, id, loc): select on code === "UNRESOLVED_IMPORT". The aggregate's own first line is only "Build failed with N error(s)" and doesn't name the file.
stripVTControlCharacters from node:util for the ANSI codes Rolldown emits even without a TTY.
Acceptance criteria:
A tier 1 repo whose src/main.tsx imports a missing ../patchy/_generated/logo.svg: patchy publish --json exits 1 with empty stdout; the stderr document's error contains ../patchy/_generated/logo.svg and src/main.tsx and no ANSI escapes; no /api/publish request is made. Text mode prints the same message.
A Vite plugin whose transform hook throws a marker string still produces the generic message, and the marker never reaches stderr. Add it beside the existing "keeps … failure diagnostics out of the public envelope" cases.
The existing suppression cases (patchy.config.ts, vite.config.ts, and the src/main.ts row, which exercises the typecheck stage because the tier 1 starter's entry is src/main.tsx) still pass unchanged.
ADR-0004 states the unresolved-import exception.
Out of scope:
Making tsc catch a missing asset. vite/client's ambient declare module "*.svg" matches any specifier without checking the file exists, and allowArbitraryExtensions / noUncheckedSideEffectImports don't change that.
Tier 0: a missing <img src="/patchy/_generated/logo.svg"> is rejected by the bundle completeness check as <img> src is not embedded without the URL. Separate concern; not filed.
patchy dev: Vite's watcher already writes the full diagnostic to the dev log (patchy dev logs).
Activity
allisonmahmood commentedon Oct 9, 2026
Agent Brief
Category: enhancement
Summary: When a repo publish's Vite build fails on an import that can't be resolved, the error names the import and the file that imports it.
Current behavior:
Repo publish runs the Vite single-file build in the builder child process. When that build throws anything other than a Patchy
LocalError(such asimport_refusedortoolchain_unsupported), the child replaces it withVite build failed. Run \pnpm exec vite build` and fix the single-file build before publishing.Text mode and--jsonboth print only that line, exit 1. The thrown error already holds the answer: Vite 8 wraps Rolldown diagnostics in an aggregate whoseerrors[]entries carry acode, and a missing import isUNRESOLVED_IMPORTwith the message[UNRESOLVED_IMPORT] Could not resolve '../patchy/_generated/logo.svg' in src/main.tsx`, followed by a code frame.The usual way in is a company look revision with no logo: a page that imports
patchy/_generated/logo.svg(as the patchy-look skill tells tier 1 and 2 pages to) passestscand then fails here without naming the file. ADR-0004 currently says build failures name the stage and diagnostic command, and that raw tool output stays outside the failure envelope. The maintainer approved a narrow exception for unresolved imports.Desired behavior:
UNRESOLVED_IMPORTdiagnostics, the failure names each missing specifier and its importer, repo-relative. Use the first line of each diagnostic with ANSI escapes stripped, and keep the hint to runpnpm exec vite build. Show at most the first few, then say how many more there are. No code frames, stacks or absolute paths.PLUGIN_ERROR, config-load throws, config syntax errors and non-Error throws. A plugin's thrown text can contain anything, so it stays out.LocalErrorrefusals (import_refused,toolchain_unsupported,invalid_manifest) are unchanged. No newcode; ADR-0004 allows build failures without one.Key interfaces:
{ ok: false, error, code? }: only theerrorstring changes. The reply is a private protocol across releases, so keep its shape.errors[]entries (code,message,id,loc): select oncode === "UNRESOLVED_IMPORT". The aggregate's own first line is only "Build failed with N error(s)" and doesn't name the file.stripVTControlCharactersfromnode:utilfor the ANSI codes Rolldown emits even without a TTY.Acceptance criteria:
src/main.tsximports a missing../patchy/_generated/logo.svg:patchy publish --jsonexits 1 with empty stdout; the stderr document'serrorcontains../patchy/_generated/logo.svgandsrc/main.tsxand no ANSI escapes; no/api/publishrequest is made. Text mode prints the same message.patchy.config.ts,vite.config.ts, and thesrc/main.tsrow, which exercises the typecheck stage because the tier 1 starter's entry issrc/main.tsx) still pass unchanged.Out of scope:
tsccatch a missing asset.vite/client's ambientdeclare module "*.svg"matches any specifier without checking the file exists, andallowArbitraryExtensions/noUncheckedSideEffectImportsdon't change that.tscfailures; typecheck output stays suppressed.<img src="/patchy/_generated/logo.svg">is rejected by the bundle completeness check as<img> src is not embeddedwithout the URL. Separate concern; not filed.patchy dev: Vite's watcher already writes the full diagnostic to the dev log (patchy dev logs).fix(patchy): publish names the import the build can't resolve