Skip to content

TypeError: can't access property 'provider', model.current() is undefined in ProviderIcon #18923

@BYK

Description

@BYK

Description

prompt-input.tsx uses local.model.current()!.provider.id with a non-null assertion inside a <Show> guard. SolidJS compiles this into a get id() getter that can fire during a reactive batch before <Show> disposes its children. When model.current() becomes undefined (e.g. provider refresh), the assertion crashes.

Error:

TypeError: can't access property "provider", r.model.current() is undefined
get id@session-*.js

Steps to reproduce

  1. Open a session
  2. Wait for a provider list refresh or model change
  3. Occasionally see the TypeError in the console

OpenCode version

latest (dev)

OS

Linux

Metadata

Metadata

Assignees

Labels

webRelates to opencode on web / desktop

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions