title: VSCode problem retrieving Bazel build targets
body: <p>I'm having trouble getting VSCode to load build targets for a Java project. The error message that I get is the following:</p>
  <pre><code>Command failed: bazel --output_base=/var/folders/cj/1fv063dx1772zbpnfpzvj_c00000gn/T/5b71fd39758e7fd8e710c281fbbdda92 query ...:* --output=package Loading: 0 packages loaded ERROR: error loading package 'bazel-test/external/rules_jvm_external': cannot load '//:private/versions.bzl': no such file Loading: 12 packages loaded currently loading: bazel-test/external/local_config_cc ... (6 packages) Loading: 12 packages loaded currently loading: bazel-test/external/local_config_cc ... (6 packages)
  </code></pre>
  <p>My WORKSPACE file is as follows:</p>
  <pre><code>load(&quot;@bazel_tools//tools/build_defs/repo:http.bzl&quot;, &quot;http_archive&quot;)
  
  http_archive(
      name = &quot;io_bazel_rules_docker&quot;,
      sha256 = &quot;4521794f0fba2e20f3bf15846ab5e01d5332e587e9ce81629c7f96c793bb7036&quot;,
      strip_prefix = &quot;rules_docker-0.14.4&quot;,
      urls = [&quot;https://github.com/bazelbuild/rules_docker/releases/download/v0.14.4/rules_docker-v0.14.4.tar.gz&quot;],
  )
  
  load(
      &quot;@io_bazel_rules_docker//repositories:repositories.bzl&quot;,
      container_repositories = &quot;repositories&quot;,
  )
  container_repositories()
  
  load(&quot;@io_bazel_rules_docker//repositories:deps.bzl&quot;, container_deps = &quot;deps&quot;)
  
  container_deps()
  
  load(&quot;@io_bazel_rules_docker//repositories:pip_repositories.bzl&quot;, &quot;pip_deps&quot;)
  
  pip_deps()
  
  load(
      &quot;@io_bazel_rules_docker//java:image.bzl&quot;,
      _java_image_repos = &quot;repositories&quot;,
  )
  
  _java_image_repos()
  
  load(
      &quot;@io_bazel_rules_docker//container:container.bzl&quot;,
      &quot;container_pull&quot;,
  )
  
  container_pull(
    name = &quot;openjdk11_slim&quot;,
    registry = &quot;index.docker.io&quot;,
    repository = &quot;library/openjdk&quot;,
    tag = &quot;11-slim&quot;
  )
  
  RULES_JVM_EXTERNAL_TAG = &quot;3.3&quot;
  RULES_JVM_EXTERNAL_SHA = &quot;d85951a92c0908c80bd8551002d66cb23c3434409c814179c0ff026b53544dab&quot;
  
  http_archive(
      name = &quot;rules_jvm_external&quot;,
      strip_prefix = &quot;rules_jvm_external-%s&quot; % RULES_JVM_EXTERNAL_TAG,
      sha256 = RULES_JVM_EXTERNAL_SHA,
      url = &quot;https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip&quot; % RULES_JVM_EXTERNAL_TAG,
  )
  
  load(&quot;@rules_jvm_external//:defs.bzl&quot;, &quot;maven_install&quot;)
  
  maven_install(
      artifacts = [
          # Accessed as dependency: @maven://io_vertx_vertx_core
          &quot;io.vertx:vertx-core:3.9.2&quot;,
          # Accessed as dependency: @maven://io_vertx_vertx_web
          &quot;io.vertx:vertx-web:3.9.2&quot;,
          # Accessed as dependency: @maven://io_vertx_vertx_rx_java2
          &quot;io.vertx:vertx-rx-java2:3.9.2&quot;,
      ],
      repositories = [
          &quot;https://repo1.maven.org/maven2&quot;,
      ]
  )
  </code></pre>
  <p>I don't see anything obviously wrong with my WORKSPACE file, so I'm tempted to assume the problem is with VSCode or in the BUILD files in one of my external dependencies. Other than that the project contains a single <code>Hello.java</code> and its accompanying <code>java_binary</code> rule. If I run myself the same query for all packages I get the following:</p>
  <pre><code>% bazel query ...:\* --output=package          
  
  src/main/java
  Loading: 0 packages loaded
  </code></pre>
  <p>In other words, there's no error. Any ideas how I could try to debug or fix this? I just installed everything on the laptop, so the software versions are:</p>
  <pre><code>Bazel version: 3.5.0
  VSCode versio: 1.48.2
  </code></pre>