fix(logger): use source maps for error stack traces in browser pretty logger by luchersou · Pull Request #6093 · Effect-TS/effect
Closes #6090
Problem
The prettyLoggerBrowser was passing the error as a string to console.error via Cause.pretty(...), which causes the browser to lose the reference to the original Error object and therefore can't resolve source maps.
Solution
Pass the actual Error objects alongside the formatted string using Cause.prettyErrors(cause), so the browser DevTools can resolve source maps correctly.
Before
After
Note
The current output shows both the formatted string from Cause.pretty and the _PrettyError objects, which results in the stack trace appearing twice.
I'm open to feedback on the preferred approach:
- Keep both (current fix) — preserves Effect's pretty formatting + source maps
- Pass only the
Errorobjects — cleaner output, similar to the workaround shown in the issue
Happy to adjust based on maintainer preference!
