Skip to content

Conversation

@lzxb
Copy link
Contributor

@lzxb lzxb commented Nov 20, 2025

Summary

This PR fixes an issue where original error information was lost when async component loading failed. Previously, when an async component threw an error, the error handler would catch it but throw a new error without preserving the original error message, making debugging difficult.

Changes Made

  • Modified the error handling in route-transition.ts to capture and include the original error message in the new error
  • Updated the corresponding test in route-transition.test.ts to verify that the original error is preserved
  • Removed an unused import in the test file

Related links

N/A

Checklist

  • Tests updated
  • Documentation updated (not required for this fix)

- Update error handling in route-transition.ts to include original error message
- Update test to verify original error is preserved in error message
- Remove unused import in test file
@cloudflare-workers-and-pages
Copy link

Deploying esmx with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2dec381
Status: ✅  Deploy successful!
Preview URL: https://bc31e0be.esmx.pages.dev
Branch Preview URL: https://fix-preserve-original-error.esmx.pages.dev

View logs

@lzxb lzxb merged commit 5c98825 into master Nov 20, 2025
4 checks passed
@lzxb lzxb deleted the fix/preserve-original-error-in-async-component-loading branch November 20, 2025 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants