anomalyco/sst · error

runtime not found

Error message

runtime not found

What it means

Collection.Run resolves the runtime for a function in dev/live mode and returns the unformatted error "runtime not found" when c.Runtime(input.Runtime) yields nothing. Unlike the Build path, this variant carries no runtime name, so the function's runtime string or the loaded runtime registrations are the things to check.

Source

Thrown at pkg/runtime/runtime.go:226

			return nil, err
		}
		ciphertext := gcm.Seal(nil, make([]byte, 12), json, nil)
		err = os.WriteFile(filepath.Join(result.Out, "resource.enc"), ciphertext, 0644)
		if err != nil {
			return nil, err
		}
	}

	return result, nil
}

func (c *Collection) Run(ctx context.Context, input *RunInput) (Worker, error) {
	slog.Info("running function", "runtime", input.Runtime, "functionID", input.FunctionID)
	runtime, ok := c.Runtime(input.Runtime)
	input.Env = append(input.Env, "SST_LIVE=true")
	input.Env = append(input.Env, "SST_DEV=true")
	if !ok {
		return nil, fmt.Errorf("runtime not found")
	}
	return runtime.Run(ctx, input)
}

func (c *Collection) ShouldRebuild(runtime string, functionID string, file string) bool {
	slog.Info("checking if function should be rebuilt", "runtime", runtime, "functionID", functionID, "file", file, "runtime", runtime)
	r, ok := c.Runtime(runtime)
	if !ok {
		return false
	}
	result := r.ShouldRebuild(functionID, file)
	slog.Info("should rebuild", "result", result, "functionID", functionID)
	return result
}

func (c *Collection) ShouldRunEagerly(runtime string) bool {
	r, ok := c.Runtime(runtime)
	if !ok {

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Verify the runtime string for the failing function in sst.config.ts
  2. Ensure any plugin registering the custom runtime is loaded in dev mode
  3. Restart `sst dev` with the same CLI version that supports the configured runtime
  4. Upgrade sst if the runtime is newer than the installed CLI
Defensive patterns

Strategy: validation

Validate before calling

null

Try / catch

if err := sstDev(); err != nil {
	if strings.Contains(err.Error(), "runtime not found") {
		// restart dev with a CLI version that registers the configured runtime
	}
}

Prevention

When it happens

Trigger: `sst dev` invokes a worker for a function whose input.Runtime has no registered runtime in the Collection — function defined with an unsupported/misspelled runtime, or the runtime was registered after this lookup. Note env vars SST_LIVE/SST_DEV are appended before the check, so they're set regardless of outcome.

Common situations: Dev session started with a stale CLI that doesn't know a newer runtime used in the config; custom runtime plugin missing in dev mode; runtime name typo only noticed when invoking the function (build path may have been cached).

Related errors


AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30). Data as JSON: /api/errors/7d485d1ac0743579. Report an issue: GitHub.