{"record":{"id":"709ae6140dc4d443","repo":"wavetermdev/waveterm","slug":"block-s-is-not-a-web-block","errorCode":null,"errorMessage":"block %s is not a web block","messagePattern":"block (.+?) is not a web block","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-web.go","lineNumber":65,"sourceCode":"\twebCmd.AddCommand(webOpenCmd)\n\twebGetCmd.Flags().BoolVarP(&webGetInner, \"inner\", \"\", false, \"get inner html (instead of outer)\")\n\twebGetCmd.Flags().BoolVarP(&webGetAll, \"all\", \"\", false, \"get all matches (querySelectorAll)\")\n\twebGetCmd.Flags().BoolVarP(&webGetJson, \"json\", \"\", false, \"output as json\")\n\twebCmd.AddCommand(webGetCmd)\n\trootCmd.AddCommand(webCmd)\n}\n\nfunc webGetRun(cmd *cobra.Command, args []string) error {\n\tfullORef, err := resolveBlockArg()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolving blockid: %w\", err)\n\t}\n\tblockInfo, err := wshclient.BlockInfoCommand(RpcClient, fullORef.OID, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"getting block info: %w\", err)\n\t}\n\tif blockInfo.Block.Meta.GetString(waveobj.MetaKey_View, \"\") != \"web\" {\n\t\treturn fmt.Errorf(\"block %s is not a web block\", fullORef.OID)\n\t}\n\tdata := wshrpc.CommandWebSelectorData{\n\t\tWorkspaceId: blockInfo.WorkspaceId,\n\t\tBlockId:     fullORef.OID,\n\t\tTabId:       blockInfo.TabId,\n\t\tSelector:    args[0],\n\t\tOpts: &wshrpc.WebSelectorOpts{\n\t\t\tInner: webGetInner,\n\t\t\tAll:   webGetAll,\n\t\t},\n\t}\n\toutput, err := wshclient.WebSelectorCommand(RpcClient, data, &wshrpc.RpcOpts{\n\t\tRoute:   wshutil.ElectronRoute,\n\t\tTimeout: 5000,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-web.go#L47-L83","documentation":"webGetRun only operates on web-view blocks. After fetching block info it checks blockInfo.Block.Meta[MetaKey_View] == \"web\"; if the target block is any other view type (terminal, preview, editor, etc.) it rejects the operation with this error naming the block OID.","triggerScenarios":"Running `wsh web get <selector> --blockid <oid>` where the OID points to a block whose meta view is not \"web\" (e.g. a terminal or preview block).","commonSituations":"Copy-pasting the wrong block id from `wsh ls`; assuming any block supports DOM selectors; targeting a webview block created before the view meta was set to \"web\".","solutions":["Pass the OID of an actual web block (open a URL in Wave to create one)","Check the block's view meta: the block meta key \"view\" must equal \"web\"","Use the correct wsh subcommand for non-web blocks"],"exampleFix":"// before\nwsh web get \"#content\" --blockid terminal-oid\n// after\nwsh web get \"#content\" --blockid web-block-oid","handlingStrategy":"validation","validationCode":"info, err := wshclient.BlockInfoCommand(RpcClient, oid, nil)\nif err == nil && info.Block.Meta.GetString(waveobj.MetaKey_View, \"\") != \"web\" {\n    return fmt.Errorf(\"block %s is not a web block\", oid)\n}","typeGuard":"func isWebBlock(info *wshrpc.RespBlockInfo) bool {\n    return info != nil && info.Block != nil && info.Block.Meta.GetString(waveobj.MetaKey_View, \"\") == \"web\"\n}","tryCatchPattern":null,"preventionTips":["Only pass OIDs of web blocks to wsh web subcommands","List blocks and inspect view meta before targeting","Name/tag web blocks in Wave to identify them easily"],"tags":["cli","validation","wave-terminal"],"backgroundTag":"wrong-block-type","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}