wavetermdev/waveterm · error

build failed: %w

Error message

build failed: %w

What it means

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).

Source

Thrown at pkg/buildercontroller/buildercontroller.go:249

		Verbose:        true,
		Open:           false,
		KeepTemp:       false,
		OutputFile:     cachePath,
		ScaffoldPath:   scaffoldPath,
		SdkReplacePath: sdkReplacePath,
		SdkVersion:     sdkVersion,
		NodePath:       nodePath,
		GoPath:         goPath,
		OutputCapture:  outputCapture,
		MoveFileBack:   true,
	})

	for _, line := range outputCapture.GetLines() {
		bc.outputBuffer.AddLine(line)
	}

	if err != nil {
		bc.handleBuildError(fmt.Errorf("build failed: %w", err), resultCh)
		return
	}

	info, err := os.Stat(cachePath)
	if err != nil {
		bc.handleBuildError(fmt.Errorf("build output not found: %w", err), resultCh)
		return
	}

	if runtime.GOOS != "windows" && info.Mode()&0111 == 0 {
		bc.handleBuildError(fmt.Errorf("build output is not executable"), resultCh)
		return
	}

	process, err := bc.runBuilderApp(ctx, appId, cachePath, builderEnv)
	if err != nil {
		bc.handleBuildError(fmt.Errorf("failed to run app: %w", err), resultCh)
		return

View on GitHub (pinned to a4447c1563)

Solutions

  1. Read the captured build output (outputBuffer lines / BuildResult build output) for the underlying compiler error
  2. Fix the compile error in the app source
  3. Check TsunamiSdkVersion/TsunamiSdkReplacePath settings point to a valid SDK
  4. Raise the 60s timeout if builds are timing out on slow machines
  5. Verify node (electron exec) and go toolchains are installed and on PATH

Example fix

// before
settings.TsunamiSdkReplacePath = "/path/to/removed/sdk"
// after
settings.TsunamiSdkReplacePath = "" // fall back to the versioned SDK from cache
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check toolchains
if _, err := exec.LookPath("go"); err != nil { return err }

Try / catch

if err := runBuild(appId); err != nil {
    var buildErr *BuildError
    if errors.As(err, &buildErr) {
        log.Printf("build output: %s", buildErr.BuildOutput) // shows compiler error
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01). Data as JSON: /api/errors/7dabeef92704110c. Report an issue: GitHub.