santifer/career-ops · warning

opening URLs is not supported on %s

Error message

opening URLs is not supported on %s

What it means

Returned by openWithDefaultApp() on operating systems the dashboard does not support for launching external apps. The file carries the build constraint `//go:build !windows && !darwin && !linux`, so it is compiled ONLY on platforms outside the supported trio (freebsd, openbsd, netbsd, solaris, dragonfly, plan9, js/wasm, etc.). On those targets the function is a permanent stub that always errors with the runtime.GOOS value; there is no xdg-open/open equivalent wired. Callers treat it as non-fatal — openCmd logs a WARN, the cover-letter handler logs a WARN, and runGeneratePDF surfaces 'PDF generated but could not open'.

Source

Thrown at dashboard/open_unsupported.go:11

//go:build !windows && !darwin && !linux

package main

import (
	"fmt"
	"runtime"
)

func openWithDefaultApp(target string) error {
	return fmt.Errorf("opening URLs is not supported on %s", runtime.GOOS)
}

View on GitHub (pinned to 9b17a8ac97)

Solutions

  1. Run the dashboard on a supported OS (linux, macOS, or windows) where openWithDefaultApp has a real implementation (xdg-open / open / cmd start).
  2. If you must run on an unsupported OS, add a new open_<goos>.go implementing openWithDefaultApp for your platform (e.g. open_freebsd.go using xdg-open or mailto handling), satisfying the build constraint so open_unsupported.go is excluded.
  3. Ignore the error at the call site — it is already downgraded to a WARN by openCmd/cover-letter handler; for the PDF path, the file is still generated on disk and can be opened manually from the path in the message.
  4. As a runtime workaround, read the target path from the dashboard message and launch it yourself with your platform's opener.

Example fix

// before: on FreeBSD every open* action returns this error
//   (open_unsupported.go is the only build that matches)
// after: add dashboard/open_freebsd.go and drop the constraint there
//
//   //go:build freebsd
//   package main
//   func openWithDefaultApp(target string) error {
//       return runOpenCommand("xdg-open", target) // or your platform's opener
//   }
//
// then rebuild; open_unsupported.go is excluded once freebsd has its own file.
Defensive patterns

Strategy: validation

Validate before calling

// Gate the call by build-time OS, mirroring the build constraint in the .go file.
//go:build !windows && !darwin && !linux
package main

// guardedOpen is a drop-in: returns a friendly message on unsupported OSes
// instead of the raw error, and lets callers short-circuit UI actions.
func canOpenExternally() bool {
	switch runtime.GOOS {
	case "linux", "darwin", "windows":
		return true
	default:
		return false
	}
}
// UI gate: only wire the 'o'/'d' keys when canOpenExternally() is true.

Try / catch

// The callers already downgrade to WARN; keep that pattern and add a pre-check
// so the user never triggers an action that's guaranteed to fail.
func openCmd(target string) tea.Cmd {
	return func() tea.Msg {
		if !canOpenExternally() {
			fmt.Fprintf(os.Stderr, "INFO: opening %q needs linux/macOS/windows\n", target)
			return nil
		}
		if err := openWithDefaultApp(target); err != nil {
			fmt.Fprintf(os.Stderr, "WARN: failed to open %q: %v\n", target, err)
		}
		return nil
	}
}

Prevention

When it happens

Trigger: Building and running the dashboard TUI (`go run .` / the dashboard binary) on FreeBSD/OpenBSD/NetBSD/Solaris/etc., then pressing 'o' to open a job URL, 'd' to open a generated CV PDF, or triggering the cover-letter viewer. Every external-launch call site returns this error.

Common situations: Cross-compiling the dashboard for a BSD/Solaris target; running career-ops on a BSD workstation; CI on a non-linux Unix that builds and smoke-tests the dashboard. Not a bug — an explicit unsupported-platform guard so the build still succeeds rather than failing to link a missing OS file.


AI-assisted analysis of santifer/career-ops@9b17a8ac97 (2026-08-13). Data as JSON: /api/errors/6c9c829cde40c633. Report an issue: GitHub.