web-infra-dev / rspress

🦀💨 A fast Rspack-based static site generator.
https://rspress.dev
MIT License
1.19k stars 107 forks source link

[Feature]: better error display #1210

Open fi3ework opened 3 days ago

fi3ework commented 3 days ago

What problem does this feature solve?

When I accidentally copied a line of incorrect code into mdx, the compilation error led to a white screen in Rspress. It took me a moment to realize that it might be due to an error in compilation. I hope for better error prompts, such as using the overlay from Rsbuild or developing an exclusive overlay for Rspress.

Google Chrome 2024-06-26 16 33 30

What does the proposed API look like?

No need to add new API.

Timeless0911 commented 3 days ago

This error is exposed at runtime, not in compilation, so the Rsbuild error overlay takes no effect.

Timeless0911 commented 3 days ago

If we do some static check, it will take a long time in build process maybe.

fi3ework commented 2 days ago

Got it, what I'm expecting might be Error Boundaries from the default theme. The boundary could include MDX content which is prone to throw error.