anomalyco / anomalyco/opencode
Webview crashes with "TypeError: undefined is not an object (evaluating 'e.groups().length')"
Open
@Hona is already working on this.
Since Aug 11, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When running bcs-code config (which spawns opencode <server-script> to serve a Config UI), opencode's webview crashes immediately with:
TypeError: undefined is not an object (evaluating 'e.groups().length')
when@http://127.0.0.1:17640/assets/index-9uLHN3Df.js:1523:15901
Environment
- opencode version: 1.18.16
- OS: macOS (darwin)
- Browser: opencode webview (port 17640)
Steps to reproduce
- Run
opencode <path-to-bun-server-script>where the script starts an HTTP server that prints a URL to stdout - opencode opens a webview to the printed URL
- Webview crashes with the above error
What works
- The HTTP server itself starts and works correctly — verified with
curl(HTTP 200, API responses are valid) - Opening the same URL in Safari/Chrome works perfectly
Stack trace (full)
TypeError: undefined is not an object (evaluating 'e.groups().length')
when@http://127.0.0.1:17640/assets/index-9uLHN3Df.js:1523:15901
@http://127.0.0.1:17640/assets/index-9uLHN3Df.js:2:15538
w5@http://127.0.0.1:17640/assets/index-9uLHN3Df.js:2:6841
Jh@http://127.0.0.1:17640/assets/index-9uLHN3Df.js:2:6598
M7@http://127.0.0.1:17640/assets/index-9uLHN3Df.js:2:5612
w5@http://127.0.0.1:17640/assets/index-9uLHN3Df.js:2:6841
Jh@http://127.0.0.1:17640/assets/index-9uLHN3Df.js:2:6598
E@http://127.0.0.1:17640/assets/index-9uLHN3Df.js:2:2111
q@http://127.0.0.1:17640/assets/index-9uLHN3Df.js:2:15566
At@http://127.0.0.1:17640/assets/index-9uLHN3Df.js:2:4069
...
The error suggests a regex .match() result is not checked for null before calling .groups().length on it, somewhere in opencode's Preact-based rendering pipeline.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.