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

554619120-b77932aa-645d-457e-b2db-d0b17d3f388b

After

error

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:

  1. Keep both (current fix) — preserves Effect's pretty formatting + source maps
  2. Pass only the Error objects — cleaner output, similar to the workaround shown in the issue

Happy to adjust based on maintainer preference!