You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It seems bottender has a hardwired path expecting an index.js in the same directory as you run the server.
I'm moving a project to typescript so the raw source is under src and I usually run in dev with ts-node
➜ server git:(move-to-ts) ✗ ts-node src/server.js
Error: Cannot find module '/Users/dc/dev/exiteer/xbot/server/index.js'
Require stack:
- /Users/dc/dev/exiteer/xbot/server/node_modules/bottender/dist/server/Server.js
- /Users/dc/dev/exiteer/xbot/server/node_modules/bottender/dist/bottender.js
- /Users/dc/dev/exiteer/xbot/server/node_modules/bottender/dist/index.js
- /Users/dc/dev/exiteer/xbot/server/src/server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
at DevServer.<anonymous> (/Users/dc/dev/exiteer/xbot/server/node_modules/bottender/src/server/Server.ts:51:37)
at Generator.next (<anonymous>)
at /Users/dc/dev/exiteer/xbot/server/node_modules/bottender/dist/server/Server.js:8:71
at new Promise (<anonymous>)
at __awaiter (/Users/dc/dev/exiteer/xbot/server/node_modules/bottender/dist/server/Server.js:4:12)
at DevServer.prepare (/Users/dc/dev/exiteer/xbot/server/node_modules/bottender/dist/server/Server.js:47:16)
I'm wondering if there's a way to pass the routes file to botTender explicitly when starting up?
src/server.js
constbot=bottender({dev: process.env.NODE_ENV!=='production',});// the request handler of the bottender appconsthandle=bot.getRequestHandler();bot.prepare().then(()=>{constserver=express();
Describe the bug
It seems bottender has a hardwired path expecting an
index.js
in the same directory as you run the server.I'm moving a project to typescript so the raw source is under
src
and I usually run in dev withts-node
I'm wondering if there's a way to pass the routes file to botTender explicitly when starting up?
I'm not quite sure how to wire those things together, there seems to be some lazy loading going on with the routing currently.
Expected behavior
A more explicit way to startup a project, less magic requires happening behind the scenes...
This is mainly to support a project in typescript
The text was updated successfully, but these errors were encountered: