Which hosting environment does this issue primarily affect?
Web apps
Which browsers and platforms do the issue happened?
Browser: Edge (latest)
Which area does this issue affect?
Protocol or service
What is the public URL for the website?
No response
Please describe the bug
In sample k.direct-line-token, the javascript web and bot project server routes and handlers were not functioning as expected, causing issues with server startup and request handling.
Environment:
npm 8.19.4
node v16.20.1
Do you see any errors in console log?
# npm start
> web@1.0.0 start
> node-dev --no-notify --respawn .
AssertionError [ERR_ASSERTION]: Handler [handler-1 on POST /api/messages] is missing a third argument (the "next" callback) but is not an async function. Middleware handlers can be either as
ync/await or callback-based.Callback-based (non-async) handlers should accept three arguments: (req, res, next). Async handler functions should accept maximum of 2 arguments: (req, res).
at Chain.add (/Users/ram/Documents/bot/BotFramework-WebChat/samples/01.getting-started/k.direct-line-token/javascript/web/node_modules/restify/lib/chain.js:79:16)
at forEach (/Users/ram/Documents/bot/BotFramework-WebChat/samples/01.getting-started/k.direct-line-token/javascript/web/node_modules/restify/lib/router.js:211:15)
at Array.forEach (<anonymous>)
at Router.mount (/Users/ram/Documents/bot/BotFramework-WebChat/samples/01.getting-started/k.direct-line-token/javascript/web/node_modules/restify/lib/router.js:203:14)
at Server.serverMethod [as post] (/Users/ram/Documents/bot/BotFramework-WebChat/samples/01.getting-started/k.direct-line-token/javascript/web/node_modules/restify/lib/server.js:1779:33)
at Object.<anonymous> (/Users/ram/Documents/bot/BotFramework-WebChat/samples/01.getting-started/k.direct-line-token/javascript/web/src/index.js:27:8)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Object.nodeDevHook [as .js] (/Users/ram/Documents/bot/BotFramework-WebChat/samples/01.getting-started/k.direct-line-token/javascript/web/node_modules/node-dev/lib/hook.js:54:7)
at Module.load (node:internal/modules/cjs/loader:1076:32)
(node:68169) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
[ERROR] 00:02:19 AssertionError: Handler [handler-1 on POST /api/messages] is missing a third argument (the "next" callback) but is not an async function. Middleware handlers can be either a
sync/await or callback-based.Callback-based (non-async) handlers should accept three arguments: (req, res, next). Async handler functions should accept maximum of 2 arguments: (req, res).
Do you have any screenshots or recordings to repro the issue?
No response
Adaptive Card JSON
No response
Additional context
This issue pertains to how Restify expects handler functions to be structured. The function should either be an async function with (req, res) or a callback-based function with (req, res, next).
Is it an issue related to Adaptive Cards?
No
Is this an accessibility issue?
No
What version of Web Chat are you using?
Latest production
Which distribution are you using Web Chat from?
Unrelated
Which hosting environment does this issue primarily affect?
Web apps
Which browsers and platforms do the issue happened?
Browser: Edge (latest)
Which area does this issue affect?
Protocol or service
What is the public URL for the website?
No response
Please describe the bug
In sample k.direct-line-token, the javascript web and bot project server routes and handlers were not functioning as expected, causing issues with server startup and request handling.
Environment:
Do you see any errors in console log?
How to reproduce the issue?
This issue reproduces in both
javascript/web
andjavascript/bot
in sample sample k.direct-line-token:javascript/web
npm i
thennpm start
to start the server./api/messages
route.javascript/bot
npm i
thennpm start
to start the server./api/messages
route.What do you expect?
Requests to the /api/messages route should be handled without errors.
What actually happened?
Received an error indicating the missing third parameter (next callback) in the handler function for the following files:
Do you have any screenshots or recordings to repro the issue?
No response
Adaptive Card JSON
No response
Additional context
This issue pertains to how Restify expects handler functions to be structured. The function should either be an async function with (req, res) or a callback-based function with (req, res, next).