Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Bug]: v2 still unloadable via npm spec on OpenCode 2.0.32 — ./v2 subpath not usable as a plugin spec; ship v2 as root default export

Abierto
#85 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
bun, typescript
Área
cli, devtools

Línea de trabajo

Start by reading package.json and the v2 entry point at dist/src/v2/index.js; compare their exports with the plugin loader error quoted in the issue. Check how the package root and v2 export are configured, then verify that the published root entry provides the v2 definition OpenCode expects while retaining the named v1 export if needed. Done means the issue's root plugin spec, "opencode-pty", loads on OpenCode 2 without a shim.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

On OpenCode 2.0.32 (macOS arm64), [email protected] still fails to load as an npm plugin. This adds two things #67 and #83 don't cover yet:

  1. The ./v2 subpath can't be used as a plugin spec. The README's V2 example is "plugins": ["opencode-pty/v2"], and OpenCode 2 parses that string as a package name rather than a subpath export. The only way left is a local shim file. I couldn't get one stable here: with a partial dependency tree, the plugin activation step hung (Location plugins did not finish activating) and blocked every command. I can't say whether that's the shim's fault or the adapter's.
  2. What would fix it: publish with the v2 definition as the package's root default export, i.e. export default define({ id, setup }) from dist/index.js. You could keep the named PTYPlugin export for v1 hosts, or gate on the host version. With that, "plugins": ["opencode-pty"] loads on v2 with no shim.

Evidence

  • package.json main: dist/index.js exports only the named PTYPlugin. exports["./v2"] points to dist/src/v2/index.js, which does contain define({ id, setup }).
  • Load error (from ~/.local/share/opencode/log/opencode.log): Plugin must export a default definition with an id and an effect or setup function.
  • npm latest is still 0.4.0, published 2026-09-18.

Related

  • #67, #83: same load failure. This issue adds the subpath-spec detail and a concrete export fix.
  • #80: once v2 loads, the adapter should also wire the permission authorizer, so that permission.bash deny/ask covers the pty tools.
Lenguaje dominante
TypeScript
Estrellas
601
Forks
66
Merge medio
4 d 9 h
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de shekohex/opencode-pty

Todos los issues de shekohex/opencode-pty

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.