question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

deprecated sendfile error message

See original GitHub issue

A bit funny error message that I have a hard time understanding 😄

Tue, 20 Dec 2016 09:48:41 GMT express deprecated res.sendfile: Use res.sendFile instead at ...

I tried to use: res.sendFile but it tells me it’s also deprecated and that I should use res.sendFile instead. So I tried res.sendFile instead but it’s also deprecated … and so on …

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
superherocommented, Dec 21, 2016

@hacksparrow yhea this is related to the upper and lower case, as you see in my example I used the lowercase. The error didn’t make sense to me because I didn’t see the difference of file and File.

0reactions
hacksparrowcommented, Dec 21, 2016

Can you create a new file with the following code and see if you still get the deprecation message?

const
express = require('express'),
app     = express(),
root    = __dirname.split('node_modules').shift() + '/public';

app.get('/img/foo/bar.jpg', (req, res) => res.sendFile(req.path, {root}));
app.use(express.static(root));
app.listen(8000);
Read more comments on GitHub >

github_iconTop Results From Across the Web

express deprecated res.sendfile - node.js - Stack Overflow
in my app i this code for i use set path for sending file. app.get('/',function(req, res){//get,put, ...
Read more >
express js error : "express deprecated res.sendfile
in my app i this code for i use set path for sending file. app.get('/',function(req, res){//get,put,post,delete res.sendfile(__ ...
Read more >
API Reference - Express 4.x
A new body object containing the parsed data is populated on the request object after the middleware ... The parsing can be aborted...
Read more >
Event Loop — Python 3.11.1 documentation
Deprecated since version 3.10: Deprecation warning is emitted if there is no current event loop. In Python 3.12 it will be an error....
Read more >
Changes — Flask Documentation (2.2.x)
Version 2.2.0¶. Released 2022-08-01. Remove previously deprecated code. #4667. Old names for some send_file ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found