Effect-TS / effect

An ecosystem of tools to build robust applications in TypeScript
https://effect.website
MIT License
6.43k stars 205 forks source link

Effect.log "swallows" array items #3184

Open mabasic opened 2 weeks ago

mabasic commented 2 weeks ago

What version of Effect is running?

3.4.5

What steps can reproduce the bug?

https://effect.website/play#705accc68b8d

What is the expected behavior?

I should see all array items and a single first item.

What do you see instead?

I see the first item, and in the list of all items the first item is null, but the rest are visible.

Additional information

When I return the value and then use console.log, the output is what is expected.

This only happens with an array of Objects. It works if you use numbers.

IMax153 commented 2 weeks ago

I did some initial investigation - this is due to the fact that the first item will be a circular reference, and for circular references undefined is JSON.stringify'ed to null in an array. The string-ification occurs in Inspectable.stringifyCircular.

mabasic commented 2 weeks ago

If this is working as intended then something is wrong with the intention :)