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.

RangeError: Invalid status code: 1

See original GitHub issue

This piece of code

app.use(sassMiddleware({
  src: path.join(__dirname, 'public'),
  dest: path.join(__dirname, 'public'),
  indentedSyntax: true, // true = .sass and false = .scss
  sourceMap: true
}));

is causing the following error:

RangeError: Invalid status code: 1
    at ServerResponse.writeHead (_http_server.js:195:11)
    at ServerResponse.writeHead (/Users/raigovind93/LPN-Fitness-App/node_modules/on-headers/index.js:55:19)
    at ServerResponse.writeHead (/Users/raigovind93/LPN-Fitness-App/node_modules/on-headers/index.js:55:19)
    at ServerResponse._implicitHeader (_http_server.js:159:8)
    at ServerResponse.end (_http_outgoing.js:621:10)
    at ServerResponse.end (/Users/raigovind93/LPN-Fitness-App/node_modules/express-session/index.js:354:19)
    at ServerResponse.send (/Users/raigovind93/LPN-Fitness-App/node_modules/express/lib/response.js:211:10)
    at done (/Users/raigovind93/LPN-Fitness-App/node_modules/express/lib/response.js:967:10)
    at Object.exports.renderFile (/Users/raigovind93/LPN-Fitness-App/node_modules/pug/lib/index.js:422:12)
    at View.exports.__express [as engine] (/Users/raigovind93/LPN-Fitness-App/node_modules/pug/lib/index.js:465:11)
    at View.render (/Users/raigovind93/LPN-Fitness-App/node_modules/express/lib/view.js:128:8)
    at tryRender (/Users/raigovind93/LPN-Fitness-App/node_modules/express/lib/application.js:640:10)
    at Function.render (/Users/raigovind93/LPN-Fitness-App/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/Users/raigovind93/LPN-Fitness-App/node_modules/express/lib/response.js:971:7)
    at /Users/raigovind93/LPN-Fitness-App/app.js:97:7
    at Layer.handle_error (/Users/raigovind93/LPN-Fitness-App/node_modules/express/lib/router/layer.js:71:5)

Could this be because the build is failing?

Here is my dependency in my package.json:

...
    "node-sass-middleware": "^0.9.8"
...

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
govindraicommented, Jul 21, 2017

Hi Nick, I finally figured it out… it was because I had a SASS syntax error, and debug: true helped me out. Still I feel like the non-compilation should throw a more helpful message…

1reaction
Emyboycommented, Nov 23, 2018

i have a similar problem . but its when i created a PUT request with knex i always retured " Unhandled rejection RangeError 1 " please any solution ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

RangeError: Invalid status code: 0 - Stack Overflow
I.e. make sure you aren't trying to set an invalid HTTP status code somewhere. It's likely this is the issue but it looks...
Read more >
"RangeError: Invalid status code: undefined" when linking to ...
when I attempt to link to the opposite side of the card. I have compared my answer to the moderators with no luck....
Read more >
Node Js RangeError [ERR_HTTP_INVALID_STATUS_CODE]
RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code : Node Js#ERR_HTTP_INVALID_STATUS_CODE#NodeJs#Programming.
Read more >
Invalid status code: 3 - Questions - OneCompiler
Getting following error while returning a number express deprecated res.send(status): Use res.sendStatus(status) instead routes/foo.js:10:9 RangeError ...
Read more >
Express.js confusion - Anyone got any idea what ... - Reddit
When I run a GET request, I get this error "RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: 4". For some reason, the status ...
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