Skip to content

tui: TUI plugin fails to load ('l.released') when project .browserslistrc uses a supports query #66808

Backlog

Description

@SunDevil311

Description

On 2.4.2, the TUI half of a package plugin fails to load when OpenCode starts in a project whose .browserslistrc contains a supports query. The server half of the same plugin loads normally.

TUI plugin error
Plugin: @sveltejs/opencode
Status: failed
Runtime: tui
Error: undefined is not an object (evaluating 'l.released')

The only l.released in the 2.4.2 binary is in the bundled browserslist's supports query handler:

supports: { select(t, r) { … for (var u in i) { var l = ra(u, t), c = l.released.length - 1; …

ra() returns undefined for any browser that the bundled caniuse feature data lists but the bundled agents data lacks.

The bundled @babel/core reaches this code during target resolution. If no targets are passed and browserslistConfigFile is not false, it calls findConfigFile(configPath) and then runs browserslist on the project's config. It looks like the plugin .jsx transpile picks up the user's project browserslist config.

The same query resolves fine with standalone browserslist@4.29.6, so the bundled browserslist/caniuse data seems inconsistent.

Expected:

  • Plugin transpiling should not read the project's browserslist config (pass browserslistConfigFile: false or explicit targets).
  • At minimum, a project's browserslist config should not stop TUI plugins from loading.

Related but different: #54943 / #61146 (time.released on plugin models).

Plugins

@sveltejs/opencode 0.1.17 (TUI entry tui.jsx), opencode-supermemory, superpowers (git)

OpenCode version

2.4.2. Regression: the same plugin's TUI half worked on 2.3.2 in the same project.

Steps to reproduce

  1. Add @sveltejs/opencode to plugins in the global opencode.jsonc.
  2. Create an empty directory with a .browserslistrc containing:
    defaults and fully supports es6-module
    
  3. Run opencode in that directory. The TUI plugin fails with the error above.
  4. Delete .browserslistrc and run opencode again. The plugin loads.

Reproduced on Windows 11 with a directory that contains only that .browserslistrc.

Log excerpt (opencode.log, path redacted):

level=WARN message="plugin operation failed" component=plugin stage=load durationMs=244 error="undefined is not an object (evaluating 'l.released')" target=@sveltejs/opencode entrypoint=file:///C:/Users/<user>/.cache/opencode/npm/@sveltejs/opencode@latest/<id>/node_modules/@sveltejs/opencode/tui.jsx role=cli

The same file's index.js (server entry) loads without error in the same run.

Operating System

Windows 11 Pro 10.0.26200 (x64)

Terminal

Windows Terminal

Activity

  1. added
    area/plugins
    type/bug
    version/v2
    on Nov 27, 2026
  2. opencodejr commented on Nov 27, 2026

    @opencodejr
    Contributor

    Seen with a simulated model or a mock server, not a real provider; a maintainer should confirm.

    Thanks for the detailed report and the minimal repro. I reproduced this on 2.4.2 on Linux with @sveltejs/opencode 0.1.17 in the global config:

    • With only a .browserslistrc containing defaults and fully supports es6-module, the footer shows 1 plugin failed and /plugins lists the TUI entry as failed. The server entry of the same plugin loads.
    • Without the .browserslistrc, the TUI plugin loads.
    • supports es6-module fails too. defaults and > 1% load, which matches your diagnosis.

    One difference: on Linux the error dialog and log show First argument must be an Error object instead of l.released. It is the same failure: the same log line, the same plugin and the same tui.jsx entry.

    It also still happens with the compiled build of today's dev (0.0.0-dev-1363). Running dev from source (740bd1d), the plugin loads. I don't think that's a fix: the dependencies involved are the same version as in 2.4.2, so it's more likely the code bundled into the compiled binary is what breaks. I couldn't confirm the 2.3.2 comparison myself.

    The recording, screenshots and drive script below show the reproduction. The script has a NO_BROWSERSLISTRC=1 control run. A maintainer will take it from here.

    https://anoma.ly/team/github-bot/media/333d3e2ced1d412565f5d433ceeb6357cce92af83c7920428a3f5132468554f3.mp4

    Screenshot

    Screenshot

    Reproduction script (drive.ts)
    // Repro for anomalyco/opencode#66808: a project .browserslistrc with a `supports`
    // query makes the TUI half of @sveltejs/opencode fail with 'l.released'.
    import { Effect } from "effect"
    import { OpenCodeDriver } from "opencode-drive"
    
    export default OpenCodeDriver.use(
      {
        ...(process.env.OC_DEV ? { opencode: { dev: process.env.OC_DEV } } : {}),
        tui: { recording: true },
        config: { plugins: ["@sveltejs/opencode"] } as any,
        project: {
          files: process.env.NO_BROWSERSLISTRC
            ? { "README.md": "control\n" }
            : { ".browserslistrc": "defaults and fully supports es6-module\n" },
        },
      },
      ({ ui }) =>
        Effect.gen(function* () {
          yield* ui.screenshot("start")
          // give the TUI time to install and load the plugin
          yield* Effect.sleep(25000)
          yield* ui.screenshot("after-plugin-load")
          // open the plugin list to show the failure details
          yield* ui.type("/plugins")
          yield* Effect.sleep(1000)
          yield* ui.enter()
          yield* Effect.sleep(2000)
          yield* ui.screenshot("plugins-dialog")
          yield* ui.enter() // "view error" on the failed TUI entry
          yield* Effect.sleep(2000)
          yield* ui.screenshot("plugin-error")
          const frame = yield* ui.capture()
          const text = JSON.stringify(frame)
          // On Linux the dialog shows "First argument must be an Error object" (Windows: 'l.released').
          // Run with NO_BROWSERSLISTRC=1 for the control: the TUI plugin then loads.
          const failed = text.includes("TUI plugin error") || text.includes("l.released") || text.includes("First argument must be an Error object")
          yield* Effect.log(failed ? "REPRODUCED: TUI plugin failed to load" : "TUI plugin loaded")
        }),
    )

    Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.

  3. added
    status/repro-simulated
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/pluginsplatform/windowsstatus/regressionstatus/repro-simulatedtype/bugversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions