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

Hubot 11 and hubot-rocketchat adapter #349

Open
matdarf opened this issue Nov 24, 2023 · 1 comment
Open

Hubot 11 and hubot-rocketchat adapter #349

matdarf opened this issue Nov 24, 2023 · 1 comment

Comments

@matdarf
Copy link

matdarf commented Nov 24, 2023

Hi,

I'm trying to get hubot and the hubot-rocketchat adapter to work together to no avail.
See below for the error and the Dockerfile I'm using:

~/rc-hubot/issue$ docker run -it --rm $(docker build -q --no-cache .)
node:internal/modules/cjs/loader:1144
  const err = new Error(message);
              ^

Error: Cannot find module 'hubot/src/adapter'
Require stack:
- /usr/local/lib/node_modules/hubot/bin/hubot
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/hubot-rocketchat/index.js:3:30)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at cjsLoader (node:internal/modules/esm/translators:345:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:294:7) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/local/lib/node_modules/hubot/bin/hubot' ]
}

Node.js v21.2.0
{"level":50,"time":1700829408199,"pid":8,"hostname":"796f33f944ec","name":"Hubot","msg":"Cannot load adapter /usr/local/lib/node_modules/hubot-rocketchat hubot-rocketchat - Error: Cannot find module 'hubot/src/adapter'\nRequire stack:\n- /usr/local/lib/node_modules/hubot/bin/hubot"}
~/rc-hubot/issue$ 

The below Dockerfile triggers the above error:

FROM node

WORKDIR /usr/local/lib/node_modules

RUN npm install -g hubot@11.0.0 && \
        git clone https://github.com/RocketChat/hubot-rocketchat.git

WORKDIR hubot-rocketchat

RUN npm install

ENTRYPOINT hubot -f $PWD -a rocketchat
@matdarf matdarf changed the title Hubot 11 and rocrocketchat adapter Hubot 11 and rocketchat adapter Nov 24, 2023
@matdarf matdarf changed the title Hubot 11 and rocketchat adapter Hubot 11 and hubot-rocketchat adapter Nov 24, 2023
@BrunoMBento
Copy link

BrunoMBento commented Jul 4, 2024

Hi @matdarf ! I've had the same problem. It happens because hubot 11 has changed hubot package from CommonJS to ESM. I've submitted this PR today to fix this. Hope repo admins accepts it.

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

No branches or pull requests

2 participants