wtfutil/wtf · error
missing mode, or mode is invalid - please set to project, pr
Error message
missing mode, or mode is invalid - please set to project, project_sections or workspace
What it means
Input validation guard in Fetch: the mode argument was empty or not one of the accepted values (project, project_sections, workspace), so the widget cannot determine which fetch strategy to use and aborts before any API call.
Source
Thrown at modules/asana/widget.go:97
}
widget.Render()
}
func (widget *Widget) Render() {
widget.Redraw(widget.content)
}
func (widget *Widget) Fetch(workspaceId, projectId, mode string, sections []string, allUsers bool) ([]*TaskItem, error) {
availableModes := map[string]interface{}{
"project": nil,
"project_sections": nil,
"workspace": nil,
}
if _, ok := availableModes[mode]; !ok {
return nil, fmt.Errorf("missing mode, or mode is invalid - please set to project, project_sections or workspace")
}
if widget.settings.apiKey != "" {
widget.settings.token = widget.settings.apiKey
} else {
widget.settings.token = os.Getenv("WTF_ASANA_TOKEN")
}
if widget.settings.token == "" {
return nil, fmt.Errorf("missing environment variable token or apikey config")
}
subMode := mode
if allUsers && mode != "workspace" {
subMode += "_all"
}
if projectId == "" && strings.HasPrefix(subMode, "project") {View on GitHub (pinned to bb838c1ccb)
Solutions
- Set the mode option in the Asana widget config to one of: project, project_sections, workspace
- Check for typos or extra whitespace in the configured mode value
- Ensure the config key is actually present — an unset mode yields an empty string, which fails this check
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at modules/asana/widget.go:97 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of wtfutil/wtf@bb838c1ccb (2026-09-03).
Data as JSON: /api/errors/21080ccb24e7931d.
Report an issue: GitHub.