Skip to content

Commit d463b8b

Browse files
authored
Slightly improve experimental.mdxRs error message with Webpack (#68356)
This is of course still not great. Is there a way/will to have codeframes similar to vercel/turborepo#8879 when using Webpack? Before: ``` Error: page.mdx:Error: Message { place: Some(Point(7:1 (87))), reason: "Unexpected end of file in expression, expected a corresponding closing brace for `{`", rule_id: "unexpected-eof", source: "markdown-rs" } Import trace for requested module: ./app/blog/hello-world/page.mdx ⨯ ./app/blog/hello-world/page.mdx ``` After: ``` Error: page.mdx:Error: 7:1: Unexpected end of file in expression, expected a corresponding closing brace for `{` (markdown-rs:unexpected-eof) Import trace for requested module: ./app/blog/hello-world/page.mdx ⨯ ./app/blog/hello-world/page.mdx ```
1 parent f57cada commit d463b8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/napi/src/mdx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl Task for MdxCompileTask {
1414
let options: Options = serde_json::from_slice(&self.option)?;
1515

1616
compile(&self.input, &options)
17-
.map_err(|err| napi::Error::new(Status::GenericFailure, format!("{:?}", err)))
17+
.map_err(|err| napi::Error::new(Status::GenericFailure, err.to_string()))
1818
}
1919

2020
fn resolve(&mut self, _env: Env, output: Self::Output) -> napi::Result<Self::JsValue> {

0 commit comments

Comments
 (0)