Strange issue with `console.log()` omitting members of objects
I'm using Itty Router with CF Workers. For some reason, when working locally and I run
console.log(req)
(in middleware, obviously) the vast majority of the members of that object are not shown.
For example, if I run:
...all I get logged is:
However, if I run:
...I get:
That's just one example of missing data. There's also a Headers
object that I know is there because I can call req.headers.get('my-header')
and it works.
Any thoughts as to what's going on here?4 Replies
query, params, route, etc aren’t part of any CF request object I know about
Is this with a routing library?
I mentioned I was using Itty Router ⬆️
@Mitya I have a bit more thorough description on your post in the Itty Discord, but I think the culprit is the weirdness in your export signature... you're basically creating and calling fetch on instantiation, which is sending a non-request through the router. Thus you only see the props that itty adds, and nothing from a real request. 🙂
Thank you, @Kevin | itty.dev , I'll reply over on the Itty server 👍