Node/Express app: req.headers is undefined
isaac-hinman
PROOP

2 years ago

I'm running a Node+Express app via a Docker container on Railway – we're migrating over from Render.

To my surprise, various endpoints are 500ing because req.headers.authorization is undefined. In fact, req.headersitself is undefined.

This is extremely unexpected/unusual behaviour, and I assume it is related to some proxy layer that Railway has in place.

I've searched around as much as I can, but found nothing helpful. I'd like to be pointed in the right direction.

Not a great DX when getting started on a platform.

Solved

4 Replies

isaac-hinman
PROOP

2 years ago

Please ignore: this is user error on our side. I suspect many of these kind of issues are slightly_smiling_face emoji


2 years ago

I'm glad you were able to solve it, if this was a platform issue we would be hearing it from just about every user sweat_smile emoji

I'm curious, what was the issue?


Status changed to Awaiting User Response Railway over 1 year ago


isaac-hinman
PROOP

2 years ago

The issue was a very tricky one, to do with Bun internals/transpilation. The worst kind of bug...


Status changed to Awaiting Railway Response Railway over 1 year ago


2 years ago

Then kudo's to you for solving it so fast!


Status changed to Awaiting User Response Railway over 1 year ago


Railway
BOT

7 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 7 months ago


Loading...