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
bun run check-types fails on main for apps/browser-extension with a type
error that is unrelated to #1552. CONTRIBUTING.md instructs contributors to run bun run check-types before submitting, so this is hit by anyone following the
documented workflow.
Error
apps/browser-extension/utils/ui-components.ts(611,13): error TS2345:
Argument of type '{ id: string; name: string | null; containerTag: string; }'
is not assignable to parameter of type '{ id: string; name: string; containerTag: string; }'.
Types of property 'name' are incompatible.
Type 'null' is not assignable to type 'string'.
Cause
createProjectSelectionModal declares its callback with a non-nullable name
(utils/ui-components.ts:405-411):
It is TypeScript-version-sensitive: TS 5.9's DOM lib does not widen this
access to | null, but bun.lock pins typescript 5.8.3 (single entry; the
extension's ^5.8.3 dedupes onto it), so the locked toolchain does hit it.
Runtime impact
None. textContent returns null only for node types such as document and
doctype; on an <option> element it is always a string. A disabled placeholder
option is always appended (utils/ui-components.ts:508-513), so select.options
is never empty and selectedIndex cannot be -1, and the if (selectedOption.value)
guard filters that placeholder out. This is a type-safety defect only.
#1446 added check-types coverage for this workspace but the app was never made
to pass, so the task is red on main. Fixing this completes that work. Separate
from #1552, which is about .wxt types going stale.
Summary
bun run check-typesfails onmainforapps/browser-extensionwith a typeerror that is unrelated to #1552. CONTRIBUTING.md instructs contributors to run
bun run check-typesbefore submitting, so this is hit by anyone following thedocumented workflow.
Error
apps/browser-extension/utils/ui-components.ts(611,13): error TS2345:
Argument of type '{ id: string; name: string | null; containerTag: string; }'
is not assignable to parameter of type '{ id: string; name: string; containerTag: string; }'.
Types of property 'name' are incompatible.
Type 'null' is not assignable to type 'string'.
Cause
createProjectSelectionModaldeclares its callback with a non-nullablename(utils/ui-components.ts:405-411):
The call site passes
Node.textContent, which isstring | null(utils/ui-components.ts:604-611):
WXT's generated tsconfig sets
strict: true, sostrictNullChecksrejects it.Why it has gone unnoticed
@supermemory/ai-sdkand@supermemory/memory-graphonly.check-typesfor this app was already failing for the unrelated reason incheck-typesin the browser extension breaks whenever a file is added topublic/until you re-runbun install#1552, so a clean run was rare.access to
| null, but bun.lock pins typescript 5.8.3 (single entry; theextension's
^5.8.3dedupes onto it), so the locked toolchain does hit it.Runtime impact
None.
textContentreturnsnullonly for node types such asdocumentanddoctype; on an
<option>element it is always a string. A disabled placeholderoption is always appended (utils/ui-components.ts:508-513), so
select.optionsis never empty and
selectedIndexcannot be -1, and theif (selectedOption.value)guard filters that placeholder out. This is a type-safety defect only.
Suggested fix
Relationship to other issues
#1446 added
check-typescoverage for this workspace but the app was never madeto pass, so the task is red on
main. Fixing this completes that work. Separatefrom #1552, which is about
.wxttypes going stale.