botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
71 stars 83 forks source link

HITLNext Crashes during Offline>Online transition when built from source #1312

Closed robertoandrade closed 3 years ago

robertoandrade commented 3 years ago

Describe the bug I've reported this already via support portal and have been exchanging messages with @laurentlp but we haven't been able to get to the bottom of why this is happening. I've put a sample project up in https://github.com/robertoandrade/botpress-hitlnext-bug

The issue as the title states is: running BP from an official release but building HITLNext module from source and linking the built version into the modules directory before starting it up, yields an error when an agent first transitions between the Offline to Online state, not even refreshing the screen brings it back to the right state. Only workaround I was able to find was to click one of the other studio pages and then come back to the HITLNext UI after that to get it to render properly.

To Reproduce Steps to reproduce the behavior:

Check the README.md on https://github.com/robertoandrade/botpress-hitlnext-bug/blob/master/README.md

Expected behavior The status of the agent to switch to Online without errors.

Screenshots image

Environment (please complete the following information):

Additional context When letting it run with the extracted version from the binary it works fine.

laurentlp commented 3 years ago

Hi @robertoandrade, changing lines 19-20 of your Dockerfile with these two seems to have fixed the issue on my end.

RUN yarn --force --ignore-engines
RUN yarn run build --linux --prod --verbose

I am still not entirely sure why you were seeing this error, but my guess what that you were building Botpress in 'development' mode. Adding --prod to yarn build will make sure to create a production build that contains the same file as the docker image or the binary.

Please let me know what you think of this solution.

Edit:

Simply adding --prod to yarn build is enough to make it work!

Second edit:

Just build you module with NODE_ENV=production yarn build --nomap --fail-on-error