title: Firebase functions won't see pubsub emulator running locally
body: <p>I'm trying to run firebase functions with pubsub locally.</p>
  <p>Have configured emulators with <code>firebase init emulators</code>.</p>
  <p><code>firebase emulators:start --only pubsub</code> works properly, I can see log:</p>
  <pre><code>┌──────────┬────────────────┐
  │ Emulator │ Host:Port      │
  ├──────────┼────────────────┤
  │ Pub/Sub  │ localhost:8085 │
  └──────────┴────────────────┘
  </code></pre>
  <p>pubsub emulator config in firebase.json:</p>
  <pre><code>&quot;pubsub&quot;: {
    &quot;host&quot;: &quot;localhost&quot;,
    &quot;port&quot;: 8085
  },
  </code></pre>
  <p>A pubsub handler function is exported:</p>
  <pre><code>exports.testPubsub = functions.pubsub.topic(&quot;test-pubsub&quot;).onPublish(async (message) =&gt; {
      console.log(`test event received by pubsub handler: ${message.json}`);
  });
  </code></pre>
  <p>I run firebase functions with: <code>firebase serve --only functions</code></p>
  <p>This line appears in console output:</p>
  <pre><code>functions[pubsub-testPubsub]: function ignored because the pubsub emulator does not exist or is not running. {&quot;metadata&quot;:{&quot;emulator&quot;:{&quot;name&quot;:&quot;functions&quot;},&quot;message&quot;:&quot;function ignored because the pubsub emulator does not exist or is not running.&quot;}}
  </code></pre>
  <p>Which means function was found but for some reason firebase cannot connect to pubsub emulator, despite all the configs.</p>
  <p>And here is the question:
  How to test pubsub and firebase functions on local machine?</p>