Skip to content

Loading local plugin silently fails in case of an error #21638

@michalkvasnicak

Description

@michalkvasnicak

Description

I'm working on a plugin and during development I'm using just local version of the plugin by placing it to .opencode/plugins/my-plugin.ts. The issue is that if there is some error in the plugin (e.g. incompatibility between node and bun) the error is just swallowed.

I believe it is because of this line

pkg ?? (source === "npm" ? await readPluginPackage(target) : await readPluginPackage(target).catch(() => undefined))
where error is swallowed in case of local plugin.

Plugins

No response

OpenCode version

1.4.0

Steps to reproduce

  1. import drizzle-orm/node-sqlite in your plugin and use it to create a database
  2. opencode loads the plugin but then it behaves like the plugin doesn't exist and there are no error logs

Screenshot and/or share link

No response

Operating System

macOS 26.3.1

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions