Skip to content

Commit 529b640

Browse files
okamoto-awsShintaro Okamoto
andauthored
fix: add missing Palette import and CI undefined-reference check (#11)
- ToolCard.tsx: Add missing Palette import from lucide-react. This caused 'ReferenceError: Palette is not defined' at runtime, crashing the /decks/ page. - ChatMessage.tsx: Fix JSX.Element -> React.JSX.Element for React 19 type compatibility (TS2503: Cannot find namespace 'JSX'). - ci.yml: Add 'Cannot find name' check to web-ui CI job. next.config.ts has ignoreBuildErrors:true which skips all type checking during build, and ESLint does not catch undefined references in TypeScript. This new step catches the most critical class of type errors that cause runtime crashes. Co-authored-by: Shintaro Okamoto <shintaok@amazon.com>
1 parent 8cd5f19 commit 529b640

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ jobs:
3838
- name: Lint
3939
run: npm run lint
4040
working-directory: web-ui
41+
- name: Check for undefined references
42+
run: |
43+
# Catch "Cannot find name" errors that cause runtime crashes
44+
# Full tsc --noEmit is not yet clean; this targets the most critical class
45+
ERRORS=$(npx tsc --noEmit 2>&1 | grep "Cannot find name" || true)
46+
if [ -n "$ERRORS" ]; then
47+
echo "$ERRORS"
48+
echo "::error::Undefined references found — these will crash at runtime"
49+
exit 1
50+
fi
51+
working-directory: web-ui
4152
- name: Build
4253
run: npm run build
4354
working-directory: web-ui

‎web-ui/src/components/chat/ChatMessage.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function renderInlinePreviews(text: string, urls: Record<string, string>): strin
5454
* @param text - Raw text that may contain mentions or color codes
5555
* @returns Array of string and JSX elements with mentions/colors highlighted
5656
*/
57-
function highlightMentions(text: string): (string | JSX.Element)[] {
57+
function highlightMentions(text: string): (string | React.JSX.Element)[] {
5858
// Combined regex: mentions OR hex color codes
5959
const COMBINED_RE = /(@Page\s\d+|@\[[^\]]+\]|#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{3})\b)/g
6060
const parts = text.split(COMBINED_RE)

‎web-ui/src/components/chat/ToolCard.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import {
2828
BookOpen, List, Search, FolderPlus, Pencil, Image,
2929
Trash2, ArrowUpDown, FolderOpen, Copy, Globe, Wrench,
30-
Check, FileText, Download, Play, Code,
30+
Check, FileText, Download, Play, Code, Palette,
3131
LayoutTemplate, Package, AlertCircle,
3232
} from "lucide-react"
3333
import type { LucideIcon } from "lucide-react"

0 commit comments

Comments
 (0)