apache/beam · error

couldn't find the following identifiers; please check for…

Error message

couldn't find the following identifiers; please check for typos, or remove them: %v

What it means

After type-checking, starcgenx.FromAsts verifies that every identifier listed in e.Ids was actually found in the package. Any identifier that the type-checker could not resolve is reported so the developer can fix typos or drop stale entries.

Solutions

  1. Fix the spelling of the identifiers named in the error message.
  2. Remove identifiers from the Ids list that no longer exist in the target package.
  3. Regenerate against the current package source after refactoring renames.

Example fix

// before
e.Ids = []string{"ParDoFn", "ParDoFn2"} // ParDoFn2 removed from source
// after
e.Ids = []string{"ParDoFn"}
Defensive patterns

Strategy: validation

Validate before calling

// Verify each configured identifier exists before generation:
// grep -R "<identifier>" ./path/to/pkg  for each name in e.Ids

Try / catch

if err := starcgenx.FromAsts(e, fset, files); err != nil {
    // error lists the missing identifiers joined by commas; fix or remove each
    return fmt.Errorf("starcgenx: %w", err)
}

Prevention

When it happens

Trigger: Calling FromAsts with a config whose Ids include names that don't exist in the analyzed package's ASTs (renamed, deleted, or misspelled symbols).

Common situations: Renaming a DoFn or symbol without updating the starcgenx ID list; removing an identifier from the source but leaving it in the generator config; typos when first writing the config.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/432f5a54256b878e. Report an issue: GitHub.

Appendix: source

Thrown at sdks/go/pkg/beam/util/starcgenx/starcgenx.go:191

		}
	}

	e.Print("CHECKING DEFS\n")
	for id, obj := range info.Defs {
		e.fromObj(fset, id, obj, idsRequired, idsFound)
	}
	e.Print("CHECKING USES\n")
	for id, obj := range info.Uses {
		e.fromObj(fset, id, obj, idsRequired, idsFound)
	}
	var notFound []string
	for _, k := range e.Ids {
		if !idsFound[k] {
			notFound = append(notFound, k)
		}
	}
	if len(notFound) > 0 {
		return errors.Errorf("couldn't find the following identifiers; please check for typos, or remove them: %v", strings.Join(notFound, ", "))
	}
	e.Print("*/\n")

	return nil
}

type findRegisterDoFnCalls struct {
	info      *types.Info
	e         *Extractor
	idsToFind map[string]bool
}

func (v findRegisterDoFnCalls) Visit(node ast.Node) (w ast.Visitor) {
	switch node := node.(type) {
	case *ast.CallExpr:
		if !v.isRegisterDoFnCall(node) {
			return v
		}

View on GitHub (pinned to 12126d8942)