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
when i am setting NODE_ENV to 'production' and sending any request getting this error:
if (done) return done(err);
^
TypeError: done is not a function
at /home/ubuntu/taskManager/node_modules/express/lib/response.js:450:22
at SendStream.ondirectory (/home/ubuntu/taskManager/node_modules/express/lib/response.js:1064:5)
at SendStream.emit (node:events:519:28)
at SendStream.redirect (/home/ubuntu/taskManager/node_modules/send/index.js:475:10)
at onstat (/home/ubuntu/taskManager/node_modules/send/index.js:723:41)
at FSReqCallback.oncomplete (node:fs:205:5)
i tried updating express version but still get the same error
The text was updated successfully, but these errors were encountered:
Thanks for reaching out! Just a heads up, we usually use GitHub issues for bug reports and feature requests. While we'd love to help everyone, we can't offer in-depth support for individual apps here. For questions like yours, Stack Overflow, reddit, or similar forums might be your best bet.
that said, it looks like somehow the third argument to res.sendFile is not a function.
It could be a middleware you are using which behaves differently depending on NODE_ENV, but if you have application code checking node env then I'd start there.
Without seeing a reproducible example it's not possible to tell if this is a bug in express or your application code. What's happening is your sendFile is encountering an error (seems to be attempting to send a directory) and then when it attempts to invoke the callback passed to sendFile with the error it received, it sees that the callback is truthy, attempts to invoke it, but fails bc the callback is not a function.
when i am setting NODE_ENV to 'production' and sending any request getting this error:
if (done) return done(err);
^
TypeError: done is not a function
at /home/ubuntu/taskManager/node_modules/express/lib/response.js:450:22
at SendStream.ondirectory (/home/ubuntu/taskManager/node_modules/express/lib/response.js:1064:5)
at SendStream.emit (node:events:519:28)
at SendStream.redirect (/home/ubuntu/taskManager/node_modules/send/index.js:475:10)
at onstat (/home/ubuntu/taskManager/node_modules/send/index.js:723:41)
at FSReqCallback.oncomplete (node:fs:205:5)
i tried updating express version but still get the same error
The text was updated successfully, but these errors were encountered: