{"record":{"id":"7a9c2bc98c61d37a","repo":"bazelbuild/bazel","slug":"s-is-experimental-and-thus-unavailable-with-the-c","errorCode":null,"errorMessage":"%s is experimental and thus unavailable with the current flags. It may be enabled by setting --%s","messagePattern":"(.+?) is experimental and thus unavailable with the current flags\\. It may be enabled by setting --(.+?)","errorType":"exception","errorClass":"Undefined","httpStatus":null,"severity":"error","filePath":"src/main/java/net/starlark/java/eval/Module.java","lineNumber":273,"sourceCode":"      }\n    }\n    return m.buildOrThrow();\n  }\n\n  /** Implements the resolver's module interface. */\n  @Override\n  public Resolver.Scope resolve(String name, boolean resolveTypeSyntax) throws Undefined {\n    // global?\n    if (globalIndex.containsKey(name)) {\n      return Resolver.Scope.GLOBAL;\n    }\n\n    // predeclared?\n    Object v = getPredeclared(name);\n    if (v != null) {\n      if (v instanceof GuardedValue) {\n        // Name is correctly spelled, but access is disabled by a flag or by client data.\n        throw new Undefined(((GuardedValue) v).getErrorFromAttemptingAccess(name));\n      }\n      return Resolver.Scope.PREDECLARED;\n    }\n\n    // universal?\n    if (Starlark.UNIVERSE.containsKey(name)) {\n      return Resolver.Scope.UNIVERSAL;\n    }\n    if (resolveTypeSyntax && Starlark.UNIVERSE_EXTRA_TYPE_CONSTRUCTORS.containsKey(name)) {\n      return Resolver.Scope.UNIVERSAL;\n    }\n\n    // undefined\n    Set<String> candidates = new HashSet<>();\n    candidates.addAll(globalIndex.keySet());\n    candidates.addAll(predeclared.keySet());\n    candidates.addAll(Starlark.UNIVERSE.keySet());\n    if (resolveTypeSyntax) {","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/bazelbuild/bazel/blob/e6e199d0601a244511b4cf18c8b2828aa73db1fd/src/main/java/net/starlark/java/eval/Module.java#L255-L291","documentation":"Raised during module resolution when a predeclared name exists but is wrapped in a FlagGuardedValue.onlyWhenExperimentalFlagIsTrue guard and the corresponding semantics flag is disabled. The name resolves (spelling is right) but access is refused, and the message tells you exactly which --flag enables it. This surfaces as a resolution error ('name ... is experimental ...'), not an EvalException at call time.","triggerScenarios":"Referencing a builtin whose definition is wrapped by StarlarkSemantics-dependent experimental flags, e.g. type() behind --experimental_enable_starlark_set or an experimental rule/builtin behind --experimental_..., without passing that flag on the Bazel/server command line.","commonSituations":"Using a freshly documented experimental Starlark feature in .bzl files while the build runs with default flags; a repo tool bump that newly guards a previously open symbol; CI using different bazel flags than the developer's workstation.","solutions":["Add the flag named in the message to the Bazel invocation: bazel build --experimental_<flag> //... (or via .bazelrc).","Guard usage in the .bzl so the symbol is only referenced when the semantics allow it (check hasattr-style probing or flag-guarded branches).","If the flag cannot be enabled in your environment, stop using the experimental symbol and use the stable equivalent.","Pin/align the Bazel version between local and CI so flag sets match."],"exampleFix":"# before (fails: symbol is experimental)\nkind = type(x)\n\n# after: enable the flag in .bazelrc\n# build --experimental_enable_starlark_set\nkind = type(x)","handlingStrategy":"validation","validationCode":"# in .bazelrc or invocation, enable the flag named in the error:\n# build --experimental_<name_of_flag>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep one canonical .bazelrc shared by local and CI so flag sets match.","Wrap experimental API usage behind a single helper so it can be flipped off quickly.","Read the error message literally: it names the exact --flag to set."],"tags":["starlark","flags","experimental","resolution","bazel"],"backgroundTag":null,"analyzedSha":"e6e199d0601a244511b4cf18c8b2828aa73db1fd","analyzedAt":"2026-08-14T10:24:27.848Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}