fix(chat): inline ChatPrompt props instead of extending external type#56
Conversation
Extending ChatPromptProps from @nuxt/ui via `defineProps<ChatPromptProps & {...}>()`
trips @vue/compiler-sfc's "resolve extends base type" pass under nuxt 4.4.6,
breaking the Vercel build. Replace with explicit local props (only the ones
we actually forward to UChatPrompt) so the SFC compiler doesn't need to chase
the type chain into node_modules.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughChatPrompt.vue replaces the external ChangesChatPrompt prop typing refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
`error?: Error | null` and `variant?: string` were too loose for UChatPrompt's `Error | undefined` and `'outline' | 'soft' | 'subtle' | 'naked'` signatures, causing typecheck to fail. Narrow both to match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/components/chat/ChatPrompt.vue (1)
10-10: ⚡ Quick winReplace
anywith a proper type for theclassprop.Using
anydefeats TypeScript's type safety. Consider using a more specific type that matches Vue's class binding expectations, such asstring | Record<string, boolean> | (string | Record<string, boolean>)[].♻️ Proposed type improvement
- class?: any + class?: string | Record<string, boolean> | (string | Record<string, boolean>)[]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/components/chat/ChatPrompt.vue` at line 10, The prop declaration for class in ChatPrompt.vue currently uses the unsafe type any; replace it with a Vue-compatible class binding type such as string | Record<string, boolean> | Array<string | Record<string, boolean>> (or the equivalent union) on the class prop to restore type safety; update the prop definition for class in the component (the prop named "class") and adjust any usages that rely on the previous any type to satisfy the new union.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app/components/chat/ChatPrompt.vue`:
- Line 10: The prop declaration for class in ChatPrompt.vue currently uses the
unsafe type any; replace it with a Vue-compatible class binding type such as
string | Record<string, boolean> | Array<string | Record<string, boolean>> (or
the equivalent union) on the class prop to restore type safety; update the prop
definition for class in the component (the prop named "class") and adjust any
usages that rely on the previous any type to satisfy the new union.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 29d69f55-acd5-4e3d-96f0-02adf71e2ebc
📒 Files selected for processing (1)
app/components/chat/ChatPrompt.vue
Summary
defineProps<ChatPromptProps & {...}>()inapp/components/chat/ChatPrompt.vuetriggers[vite:vue] [@vue/compiler-sfc] Failed to resolve extends base typeundernuxt@4.4.6, blocking the Vercel build on chore(deps): update dependency nuxt to ^4.4.6 #54.UChatPrompt(variant,disabled,class), so the SFC compiler doesn't have to chase the type chain intonode_modules/@nuxt/ui.nuxtpatch bump (chore(deps): update dependency nuxt to ^4.4.6 #54). Worth a separate upstream report tonuxt/nuxtsincemain(withnuxt@4.4.5) compiles fine.Test plan
pnpm buildpasses locally onnuxt@4.4.5.nuxt@4.4.6.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Refactor