Launcher Unhandled Rejection [TypeError, Cannot read property 'createUser' of undefined]

149 views Asked by At

I'm testing Botpress under Windows. Just downloaded latest binaries, unpacked BP, embedded to site and ran default 'Welcome' bot without modifications. When I started webpage and chat to bot, it gives an error in a log:

11/05/2022 11:27:32.360 Launcher Unhandled Rejection [TypeError, Cannot read property 'createUser' of undefined]
STACK TRACE
TypeError: Cannot read property 'createUser' of undefined
    at createUserAndMapping (D:\BP\modules\.cache\module__d0e38ff623b6650226052190807718b3c404a5abd91392600c244105b0360b2f\dist\backend\db.js:56:54)
    at WebchatDb.mapVisitor (D:\BP\modules\.cache\module__d0e38ff623b6650226052190807718b3c404a5abd91392600c244105b0360b2f\dist\backend\db.js:61:13)
    at async D:\BP\modules\.cache\module__d0e38ff623b6650226052190807718b3c404a5abd91392600c244105b0360b2f\dist\backend\api.js:153:20
1

There are 1 answers

0
Pinton On

I have had this error with no solution before but solved it. My solution was starting the botId with small caps, even though my bot starts with caps. So check that first. Hope it helps

<script>
    window.botpressWebChat.init({
        host: 'http://localhost:3000',
        botId: 'testbot', // lower case
        hideWidget: false
    })
</script>