Bazel "Skipping ... no such target" in CI
Bazel found the package but no target with the requested name. The rule was renamed, never declared, or the label has a typo.
What this error means
A build reports "ERROR: Skipping //pkg:name: no such target //pkg:name: target name not declared in package". Bazel often lists the valid target names it did find.
ERROR: Skipping '//libs/auth:server': no such target '//libs/auth:server':
target 'server' not declared in package 'libs/auth' defined by
/workspace/libs/auth/BUILD.bazel (did you mean 'auth_server'?)Common causes
Target name does not exist
The label names a rule that is not declared in that package BUILD file. Bazel suggests near matches when it can.
Rule renamed without updating callers
A target was renamed in the BUILD file but scripts, CI commands, or deps still reference the old name.
Typo in the label
Bazel target names are exact and case-sensitive; auth_server and authServer are different targets.
How to fix it
List the real targets in the package
- Query the package to see what targets actually exist.
- Match the label to one of them exactly.
bazel query '//libs/auth:*'Fix the label or declare the target
- Correct the name in the failing command or dependency.
- Or add the missing rule to the package BUILD file.
How to prevent it
- Use bazel query in code review to verify target names, and grep for old names after any rename.