fix(attachment): replace never exhaustive check to fix Colab TS2322 build error
`attachment.type` resolves to `string & {}` via @assistant-ui/store@0.1.6's
generic type chain when installed through npm (package-lock.json), breaking
the `const _exhaustiveCheck: never = type` exhaustive check pattern.
Replace with a direct throw that compiles cleanly across library versions
while preserving identical runtime behaviour.
Fixes #263
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
2513d1b623
commit
babc88fbee
1 changed files with 2 additions and 4 deletions
|
|
@ -149,10 +149,8 @@ const AttachmentUI: FC = () => {
|
|||
return "Document";
|
||||
case "file":
|
||||
return "File";
|
||||
default: {
|
||||
const _exhaustiveCheck: never = type;
|
||||
throw new Error(`Unknown attachment type: ${_exhaustiveCheck}`);
|
||||
}
|
||||
default:
|
||||
throw new Error(`Unknown attachment type: ${type as string}`);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue