wavetermdev/waveterm · error
resolving blockid: %w
Error message
resolving blockid: %w
What it means
`wsh web get` needs to resolve its block argument to a full ORef (object reference). resolveBlockArg failed, meaning the blockid/circuit arg could not be turned into a valid block reference before any RPC. This is a client-side resolution failure.
Source
Thrown at cmd/wsh/cmd/wshcmd-web.go:58
var webGetJson bool
var webOpenMagnified bool
var webOpenReplaceBlock string
func init() {
webOpenCmd.Flags().BoolVarP(&webOpenMagnified, "magnified", "m", false, "open view in magnified mode")
webOpenCmd.Flags().StringVarP(&webOpenReplaceBlock, "replace", "r", "", "replace block")
webCmd.AddCommand(webOpenCmd)
webGetCmd.Flags().BoolVarP(&webGetInner, "inner", "", false, "get inner html (instead of outer)")
webGetCmd.Flags().BoolVarP(&webGetAll, "all", "", false, "get all matches (querySelectorAll)")
webGetCmd.Flags().BoolVarP(&webGetJson, "json", "", false, "output as json")
webCmd.AddCommand(webGetCmd)
rootCmd.AddCommand(webCmd)
}
func webGetRun(cmd *cobra.Command, args []string) error {
fullORef, err := resolveBlockArg()
if err != nil {
return fmt.Errorf("resolving blockid: %w", err)
}
blockInfo, err := wshclient.BlockInfoCommand(RpcClient, fullORef.OID, nil)
if err != nil {
return fmt.Errorf("getting block info: %w", err)
}
if blockInfo.Block.Meta.GetString(waveobj.MetaKey_View, "") != "web" {
return fmt.Errorf("block %s is not a web block", fullORef.OID)
}
data := wshrpc.CommandWebSelectorData{
WorkspaceId: blockInfo.WorkspaceId,
BlockId: fullORef.OID,
TabId: blockInfo.TabId,
Selector: args[0],
Opts: &wshrpc.WebSelectorOpts{
Inner: webGetInner,
All: webGetAll,
},
}View on GitHub (pinned to a4447c1563)
Solutions
- Pass an explicit valid block id: `wsh web get <blockid>` from inside the target block.
- Run the command from inside a Wave block so the block id env is set.
- Verify the block still exists/is open in the terminal.
- Check `wsh ls` output for the correct block id syntax.
Example fix
// before wsh web get # relies on ambient block context // after wsh web get B<oid> # or run inside the web block
Defensive patterns
Strategy: validation
Validate before calling
if os.Getenv("WAVETERM_BLOCKID") == "" && len(args) < 1 { fatal("no block id supplied") } Type guard
func looksLikeOID(s string) bool { return len(s) >= 8 && !strings.ContainsAny(s, " /\\t") } Try / catch
fullORef, err := resolveBlockArg()
if err != nil { fmt.Fprintf(os.Stderr, "pass an explicit blockid: %v\n", err); os.Exit(2) } Prevention
- Run `wsh web get` inside a Wave block or pass an explicit block id.
- Copy block ids from `wsh ls` to avoid truncation.
- Ensure the referenced block is still open.
When it happens
Trigger: Running `wsh web get <arg>` with a missing, malformed, or unresolvable block id (e.g. no blockid in env, invalid OID syntax, or the circuit syntax failing to resolve to a block).
Common situations: Running wsh web get outside a block context (no WAVETERM_BLOCKID), pasting a partial/truncated block id, or referencing a block that has been closed.
Related errors
- no files or message provided
- too many files (maximum %d files allowed)
- stdin (-) can only be used once
- WAVETERM_TABID environment variable not set
- resolving block: %v
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/0399bd4239d59af2.
Report an issue: GitHub.