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.

bug: Response.location doesn't exist

See original GitHub issue

Issue

Response object doesn’t have the location property, neither redirect.

Details

Technically, there is a location property on Response object as said here: https://github.com/asos-craigmorten/opine/blob/master/.github/API/response.md#reslocationpath

But there isn’t, here a simple example:

I would like the route “/redirect” to redirect to “/home”:

app.get('/redirect',(req,res,next)=>{
	res.location("/home") //location doesn't exist
})

I don’t know if I am doing anything wrong or it’s really a bug.

Thanks 😄

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
asos-craigmortencommented, May 27, 2020

Thanks ! it worked!

app.get('/redirect',(req,res)=>{
	(res as any).location("/home").sendStatus(301);
})

Released in version 0.5.1 - if you pull done the latest, you will no longer need the any type casting.

2reactions
marc2332commented, May 27, 2020

Thanks ! it worked!

app.get('/redirect',(req,res)=>{
	(res as any).location("/home").sendStatus(301);
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Failed to launch chromium because executable doesn't ...
I fixed my issue by downloading the browser to the project's node modules and accessing it from there and specifying the location with...
Read more >
54367 – Location header in response to PUT is not %-escaped
The DAV PUT method returns the location of the newly created resource in the Location: header of the response (RFC2616 14.30; RFC4918 13.1)....
Read more >
Error Messages | Maps JavaScript API - Google Developers
This page describes the error messages that can be returned by the Maps JavaScript API. The Maps JavaScript API writes error and warning...
Read more >
unknown error: DevToolsActivePort file doesn't exist while ...
As per my observation DevToolsActivePort file doesn't exist is caused when chrome is unable to find its reference in scoped_dirXXXXX folder.
Read more >
466874 - Mouse pointer location doesn't match blink hit-test ...
Glad you use me as a bellwether of weird Mac bugs :) No, I haven't seen this. For those that have, while Chrome...
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