fix(plugin-playground): include source path in mdx parse errors - #3486
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves @rspress/plugin-playground diagnostics when MDX pre-scan/parsing fails by attaching the source file path to the thrown error, and adds a regression test to validate the new message shape.
Changes:
- Wrap MDX parse failures with an error message that includes the failing source file path while preserving the original parser message.
- Add a unit test that exercises the plugin hook and asserts the thrown error includes the source file path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/plugin-playground/src/cli/index.ts | Enhances thrown parse errors to include the source path (and retains original message via wrapping). |
| packages/plugin-playground/tests/error.test.ts | Adds a regression test for the improved error message when MDX parsing fails. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Deploying rspress-v2 with
|
| Latest commit: |
21b2e14
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://dabf1402.rspress-v2.pages.dev |
| Branch Preview URL: | https://fix-playground-mdx-error-con.rspress-v2.pages.dev |
SoonIter
force-pushed
the
fix/playground-mdx-error-context
branch
from
July 1, 2026 09:48
13301bb to
636f91d
Compare
SoonIter
force-pushed
the
fix/playground-mdx-error-context
branch
from
July 1, 2026 09:50
636f91d to
21b2e14
Compare
SoonIter
enabled auto-merge (squash)
July 1, 2026 09:56
Timeless0911
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves
@rspress/plugin-playgrounddiagnostics when its MDX pre-scan fails. Instead of rethrowing the parser error without context, the plugin now includes the source file path while preserving the original parser message.Related Issue
Fixes #2238
Checklist