{"record":{"id":"7dabeef92704110c","repo":"wavetermdev/waveterm","slug":"build-failed-w","errorCode":null,"errorMessage":"build failed: %w","messagePattern":"build failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/buildercontroller/buildercontroller.go","lineNumber":249,"sourceCode":"\t\tVerbose:        true,\n\t\tOpen:           false,\n\t\tKeepTemp:       false,\n\t\tOutputFile:     cachePath,\n\t\tScaffoldPath:   scaffoldPath,\n\t\tSdkReplacePath: sdkReplacePath,\n\t\tSdkVersion:     sdkVersion,\n\t\tNodePath:       nodePath,\n\t\tGoPath:         goPath,\n\t\tOutputCapture:  outputCapture,\n\t\tMoveFileBack:   true,\n\t})\n\n\tfor _, line := range outputCapture.GetLines() {\n\t\tbc.outputBuffer.AddLine(line)\n\t}\n\n\tif err != nil {\n\t\tbc.handleBuildError(fmt.Errorf(\"build failed: %w\", err), resultCh)\n\t\treturn\n\t}\n\n\tinfo, err := os.Stat(cachePath)\n\tif err != nil {\n\t\tbc.handleBuildError(fmt.Errorf(\"build output not found: %w\", err), resultCh)\n\t\treturn\n\t}\n\n\tif runtime.GOOS != \"windows\" && info.Mode()&0111 == 0 {\n\t\tbc.handleBuildError(fmt.Errorf(\"build output is not executable\"), resultCh)\n\t\treturn\n\t}\n\n\tprocess, err := bc.runBuilderApp(ctx, appId, cachePath, builderEnv)\n\tif err != nil {\n\t\tbc.handleBuildError(fmt.Errorf(\"failed to run app: %w\", err), resultCh)\n\t\treturn","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/buildercontroller/buildercontroller.go#L231-L267","documentation":"The controller runs build.TsunamiBuildInternal with the configured options; if that returns an error the whole build is reported as \"build failed\" with the wrapped cause. This is the generic build-step failure point for Tsunami app builds (scaffold, npm/node, go compile steps).","triggerScenarios":"TsunamiBuildInternal returns error — compile errors in app source, scaffold failure, sdk replace path invalid, npm/go toolchain failures, or the 60s build context timeout expiring.","commonSituations":"Syntax/type errors in user app code; TsunamiSdkVersion unavailable; TsunamiSdkReplacePath pointing to a nonexistent local SDK; slow machine hitting the 60-second build timeout; missing Go or node toolchain.","solutions":["Read the captured build output (outputBuffer lines / BuildResult build output) for the underlying compiler error","Fix the compile error in the app source","Check TsunamiSdkVersion/TsunamiSdkReplacePath settings point to a valid SDK","Raise the 60s timeout if builds are timing out on slow machines","Verify node (electron exec) and go toolchains are installed and on PATH"],"exampleFix":"// before\nsettings.TsunamiSdkReplacePath = \"/path/to/removed/sdk\"\n// after\nsettings.TsunamiSdkReplacePath = \"\" // fall back to the versioned SDK from cache","handlingStrategy":"try-catch","validationCode":"// pre-check toolchains\nif _, err := exec.LookPath(\"go\"); err != nil { return err }","typeGuard":null,"tryCatchPattern":"if err := runBuild(appId); err != nil {\n    var buildErr *BuildError\n    if errors.As(err, &buildErr) {\n        log.Printf(\"build output: %s\", buildErr.BuildOutput) // shows compiler error\n    }\n}","preventionTips":["Read the captured build output lines to find the root compiler error","Pin a valid TsunamiSdkVersion in settings","Keep builds under the 60s timeout or pre-build dependencies","Validate TsunamiSdkReplacePath points at an existing SDK"],"tags":["go","build","toolchain"],"backgroundTag":"build-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}