Skip to content

Commit 487a8e7

Browse files
committed
Fix visual parity Lit harness broken after merge
The Lit harness stopped rendering after the merge because: 1. @a2ui/markdown-it was pinned to ^0.0.1 (npm registry) which has a synchronous renderMarkdown(). After commit b904548 made MarkdownRenderer async, the Lit directive calls .then() on the result, causing "markdownRenderer(...).then is not a function". Fix: switch to file:../../markdown/markdown-it to stay in sync with the local source (now async, v0.0.2). 2. The React Vite dev server lazily discovers @a2ui/web_core subpath imports, triggering "optimized dependencies changed. reloading" mid-page-load which causes blank screenshots in Playwright. Fix: add web_core subpath imports to optimizeDeps.include so Vite pre-bundles them upfront.
1 parent fe74e8c commit 487a8e7

3 files changed

Lines changed: 35 additions & 57 deletions

File tree

renderers/react/visual-parity/package-lock.json

Lines changed: 28 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

renderers/react/visual-parity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"dependencies": {
1818
"@a2ui/lit": "file:../../lit",
19-
"@a2ui/markdown-it": "^0.0.1",
19+
"@a2ui/markdown-it": "file:../../markdown/markdown-it",
2020
"@a2ui/react": "file:..",
2121
"@lit/context": "^1.1.0",
2222
"lit": "^3.1.0",

renderers/react/visual-parity/react/vite.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ export default defineConfig({
2828
optimizeDeps: {
2929
// Always re-optimize on startup so rebuilds of file: deps don't cause 504s
3030
force: true,
31+
// Pre-bundle web_core subpath imports so Vite doesn't discover them lazily
32+
// (which causes "optimized dependencies changed. reloading" mid-page-load)
33+
include: [
34+
'@a2ui/web_core/styles/index',
35+
'@a2ui/web_core/data/model-processor',
36+
],
3137
exclude: [
3238
'@a2ui/react',
3339
'@a2ui/lit',

0 commit comments

Comments
 (0)