hot-import icon indicating copy to clipboard operation
hot-import copied to clipboard

Hotimport will occur error when update the code

Open lijiarui opened this issue 7 years ago • 1 comments

Reproduce

  1. In file a.ts I using the following code
if (!hotMod || !hotMod.connector) {
    hotMod = await hotImport('../bot-logic')
    console.log('####### connector init inside on image', hotMod)
  }

  hotMod.connector.processMessage(message.room() || message.from(), message.from(), '#faceExist' + md5List)

../bot-logic code as follows

export const connector = new WechatyConnector()
  1. When I change code in a.ts, it will throw error
####### connector init inside on image undefined
TypeError: Cannot read property 'connector' of undefined
    at Wechaty.<anonymous> (/Users/jiaruili/git/rui/wechaty-blinder/src/listeners/message.ts:265:9)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/jiaruili/git/rui/wechaty-blinder/src/listeners/message.ts:4:58)
    at <anonymous>
21:15:20 WARN Contact parse() got empty rawObj!
  1. When I restart the code, the error will disappear, if I change code in a.ts again, I will get the following error again.

lijiarui avatar Dec 05 '17 13:12 lijiarui

Sorry, I want to help but what you provide is not a minimum executable code.

huan avatar Dec 05 '17 13:12 huan