Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Botbuilder dependency #42

Open
spezam opened this issue Oct 4, 2018 · 10 comments
Open

Botbuilder dependency #42

spezam opened this issue Oct 4, 2018 · 10 comments
Labels

Comments

@spezam
Copy link

spezam commented Oct 4, 2018

In package.json botbuilder dependency is defined as
"botbuilder": ">=3.5.0"

Since botbuilder moved from version 3.15.0 to 4.0.6 the framework is downloading the latest and greates. Unfortunately Hubot is throwing an error on startup:
[Thu Oct 04 2018 05:22:21 GMT+0000 (UTC)] ERROR Cannot load adapter botframework - TypeError: BotBuilder.ChatConnector is not a constructor

rolling back to 3.5.0 fix the issues.

@angegar
Copy link

angegar commented Nov 10, 2018

Hi , my bot can't start with the following error :

[Sat Nov 10 2018 22:04:06 GMT+0000 (Coordinated Universal Time)] DEBUG Loading adapter botframework
[Sat Nov 10 2018 22:04:07 GMT+0000 (Coordinated Universal Time)] INFO hubot-botframework-adapter: Adapter loaded. Using appId c2d967d2-3262-4842-b348-3c1eee95a4df
[Sat Nov 10 2018 22:04:07 GMT+0000 (Coordinated Universal Time)] ERROR Cannot load adapter botframework - TypeError: this.connector.onInvoke is not a function

It sounds similar to the @spezam one.

@spezam can you please more precisely detail what did you do ? My bot previously worked without anything specified for BoBuilder.

@spezam
Copy link
Author

spezam commented Nov 11, 2018

Hi @angegar,
I run the bot in a Docker container, so before starting the process I force the installation of a previous version of the botbuilder npm module, as:

CMD bash -c "npm install [email protected] && bin/hubot -n $HUBOT_NAME --adapter botframework"

@angegar
Copy link

angegar commented Nov 11, 2018

Hi @spezam ,
Thank you for your answer. This is what i did (i think) but in another way.

In the package.json i added the botbuilder dependency :

  "dependencies": {
    "aws-sdk": "^2.310.0",
    "hubot": "^3.1.1",
    "hubot-auth": "^2.1.0",
    "hubot-botframework": "https://github.com/Microsoft/BotFramework-Hubot.git",
    "hubot-diagnostics": "^1.0.0",
    "hubot-redis-brain": "^1.0.0",
    "node-ssh": "^5.1.2",
    "winston": "^3.0.0",
    "fs":"^0.0.1-security",
    "xml2js":"^0.4.19",
    "botbuilder": "3.15.0"
  },

Then in my docker file i run :

COPY "package.json" "./"

RUN yo hubot --name="devbot" --description="Bot" --owner="me" --defaults &&\
#    rm package.json && \
    rm external-scripts.json && \
    rm hubot-scripts.json

COPY "external-scripts.json" "./"
RUN npm install --save

So if i well understand it should install the good version of botbuilder.

Finally i start my bot with :

ENTRYPOINT ["/home/hubot/bin/hubot","-a","botframework"]

But i still have the same issue.

@spezam
Copy link
Author

spezam commented Nov 12, 2018

That should do the trick. Did you check what version of the botframework is in the container?

Also, I would try to change
ENTRYPOINT ["/home/hubot/bin/hubot","-a","botframework"]
to
CMD bash -c "npm install [email protected] && /home/hubot/bin/hubot --adapter botframework"

just for testing.

@angegar
Copy link

angegar commented Nov 12, 2018

@spezam ,
Thank you a lot you help me to find a bug in my script ;) Now it is working like a charm.

For information the bug was i copied th package.json before the hubot installation, thus i guess that the chat bot installation override my package.json that explain why putting the botBuilder version in package.json did not work.

@spezam
Copy link
Author

spezam commented Nov 12, 2018

Glad it worked! Now I remember why I did the npm install on startup.
Pretty horrible hack.

I'll PR a fix to the package.json, as it seems nobody has a good solution to make it work with more recent versions of botbuilder.

@MatSFT
Copy link

MatSFT commented Nov 12, 2018

Please review this if you folks have a chance: #44

@esell
Copy link

esell commented Jun 13, 2019

@MattSFT As an FYI, I just created a new hubot via the instructions in the README and ran into the same issue. Doing a npm install [email protected] resolved the issue.

@agxs
Copy link

agxs commented Feb 24, 2020

For anyone else experiencing this issue I had to make sure I was using the git url as above for hubot-botframework and NOT version 0.10.1 which npm install gives you.

@65Mustang289
Copy link

Alternatively add a resolutions section to your package.json

"resolutions": {
    "**/botbuilder": "3.30.0"
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants