Open jdoss opened 1 year ago
Hey @jdoss! Thank you for sharing this issue as well as a workaround for it!
Since this project is no longer under active development, there are no immediate plans to support the latest versions of Hubot. However, since others might encounter this same issue we can keep this issue open for now.
Really appreciate your investigation into this, and I also hope pinning to <4.0.0
is suitable for the bot you're building!
No problem @zimeg. Pinning to 4.0.0
works fine for my needs as I have an group of old coworkers in a slack and we can't seem to live without the hubot-plusplus plugin in our chat.
I created a new Slack adapter for use with the latest Hubot version if you're interested in updating. I know it might be some work to update, though. Let me know how I can help.
I am also facing different issues while trying hubot-slack adapter.
npm list -g
/usr/local/lib
├── coffeescript@1.11.1
├── corepack@0.19.0
├── generator-hubot@0.4.0
├── hubot-diagnostics@1.2.0
├── hubot-plusplus@1.4.0
├── hubot-redis-brain@2.0.0
├── hubot-slack@4.10.0
├── hubot-yubikey-invalidation@0.0.3
├── hubot@3.5.0
├── n@9.1.0
├── npm@10.0.0
├── slack@11.0.2
└── yo@4.3.1
package.json
{
"name": "test",
"version": "0.0.0",
"private": true,
"author": "User <user@example.com>",
"description": "A simple helpful robot for your Company",
"dependencies": {
"hubot": "3.5.0",
"hubot-diagnostics": "^1.2.0",
"hubot-google-images": "^0.2.7",
"hubot-google-translate": "^0.2.1",
"hubot-help": "^2.1.1",
"hubot-heroku-keepalive": "^1.0.3",
"hubot-maps": "^0.0.3",
"hubot-pugme": "^0.1.1",
"hubot-redis-brain": "^2.0.0",
"hubot-rules": "^1.0.0",
"hubot-scripts": "^2.17.2",
"hubot-shipit": "^0.2.1",
"hubot-slack": "^4.10.0"
},
"engines": {
"node": "20.x"
}
}
external-scripts.json
[
"hubot-diagnostics",
"hubot-help",
"hubot-slack",
"hubot-google-images",
"hubot-google-translate",
"hubot-pugme",
"hubot-maps",
"hubot-redis-brain",
"hubot-rules",
"hubot-shipit"
]
And after running: HUBOT_SLACK_TOKEN=xoxb-123-xyzn ./bin/hubot --adapter slack
Run `npm audit` for details.
[Thu Sep 07 2023 17:31:40 GMT+0000 (Coordinated Universal Time)] ERROR Cannot load adapter slack - /home/hubot/cleverbot/node_modules/hubot-slack/src/bot.coffee:22:10: error: unexpected newline
super
^
Not sure what i am missing but i can't make it work. Any help would be appreciated.
@evercast-mahesh2021, that error is because it's not running the script through coffee script.
I got a successful startup with these steps:
npm i coffeescript@1.11.1
<- Install coffeescript module within your app, as opposed to relying on the globally installed versionpackage.json
file: "scripts": {
"start": "hubot --adapter slack"
}
HUBOT_SLACK_TOKEN=xoxb-123-xyzn npm start
➜ myhubot git:(main) ✗ node --version
v20.6.0
Hi @joeyguerra thank you so much for the help. I got passed this issue but facing another one. Any idea? It is complaining about hubot module. Thanks
Hubot> [Mon Sep 11 2023 15:01:20 GMT+0000 (Coordinated Universal Time)] ERROR Error loading scripts from npm package - TypeError: require(...) is not a function
at /usr/local/lib/node_modules/hubot/src/robot.js:409:52
at Array.forEach (<anonymous>:null:null)
at Robot.loadExternalScripts (/usr/local/lib/node_modules/hubot/src/robot.js:409:25)
at /usr/local/lib/node_modules/hubot/bin/hubot.js:203:13
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)
@evercast-mahesh2021 delete "hubot-slack",
from external-scripts.json
.
@evercast-mahesh2021 delete
"hubot-slack",
fromexternal-scripts.json
.
Oh, awesome. It worked. Thanks for all the help.
HI guys, has anyone managed to find any other solution? I followed all the previous steps with the same versions that were mentioned but I still have the same problem
ERROR Cannot load adapter slack - /home/hubot/node_modules/hubot-slack/src/bot.coffee:22:10: error: unexpected newline
@leonardoivt I believe that error is from not having coffeescript
installed. Post the results of npm list -g
, your package.json
file and command your executing so we can put another pair of eyes on it.
hey @joeyguerra thanks for reply, sorry for taking so long to respond, I managed to solve the problem using the dependencie versions stipulated in this thread; hubot : 3.5.0 coffeescript : 1.11.1
Any version of Hubot greater than 4.0.0 can no longer use this adapter.
I had pin the following versions to get things working again.