Promise can't return msg

Hello Root,

const bluebird = global.get("bluebird")  // reference library

const p = new Promise((resolve, reject) => {
    setTimeout(() => {
        resolve(10)
    }, 1000)
})

p.then(number => {
    msg.topic = "My promise number"
    msg.payload = number
    //node.warn(msg.topic)
    node.send(msg)
})
  1. you were referencing the library wrong (Documentation)
  2. you had the ms timeout outside the brackets
  3. dont know what the library does .. thats up to you :wink:
1 Like