title: google-cloud-pubsubTypeError: state.topic.publish is not a function
body: <p>This is image from node red in terminal</p>
  
  <p><a href="https://i.stack.imgur.com/jXFuA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jXFuA.png" alt="enter image description here"></a></p>
  
  <p>I am working in the sphere of IoT, and want to push message to Pub/Sub in Google, but every time when I run my node-Red, I've got the following error:</p>
  
  <blockquote>
    <p>25 Dec 18:40:49 - [error] [google-cloud-pubsub out:b2451409.071148] TypeError: state.topic.publish is not a function*</p>
  </blockquote>
  
  <p>As a source code, I used pub/sub contribution in github, link:
  <a href="https://github.com/GoogleCloudPlatform/node-red-contrib-google-cloud/blob/master/pubsub.js" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/node-red-contrib-google-cloud/blob/master/pubsub.js</a> 
  It seems that code works fine with credentials and it does create new-topic in Google,in the case, when topic is not present in the cloud, however the message is not published to the topic. In the case of repeating messages in particular interval, the problem above is arising.
  Does anyone know how to solve this problem?</p>