Skip to content

Commit aaad3da

Browse files
committed
Turbopack panics: create discussions with pre-filled errors
This: - Prompts users to report turbopack internal errors as new GitHub discussions instead of issues - Encodes the error message and debug information into the discussion title and body respectively - Since these encoded urls can be lengthy, it uses [Terminal Hyperlinks](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) to present things concisely without excessive wrapping. If the terminal does not support this, only the error message is sent. - Removes specific panic handling in favor of the `subscribe` napi error handler. This seems to be the vast majority of panics. Test Plan: In a terminal with hyperlink support `FORCE_HYPERLINK=1 pnpm next dev --turbo examples/basic-css/`: ``` ----- FATAL: An unexpected Turbopack error occurred. A panic log has been written to /var/folders/sk/zy7023wd30j0dxpmdv3nylm80000gn/T/next-panic-bf6bdb325db0f5ed5599cf332d8e364a.log. To help make Turbopack better, report this error by clicking here. ----- ``` Where the link generated is [clicking here.](https://github.com/vercel/next.js/discussions/new?category=error-report&title=Turbopack%20Error%3A%20Panic%20in%20AppProject%3A%3Anew%3A%20Some%28%22oh%20no%20new%20app%21%22%29&body=Error%20message%3A%0A%60%60%60%0APanic%20in%20AppProject%3A%3Anew%3A%20Some%28%22oh%20no%20new%20app%21%22%29%0A%0ADebug%20info%3A%0A-%20Execution%20of%20get_entrypoints_with_issues_operation%20failed%0A-%20Execution%20of%20EntrypointsOperation%3A%3Anew%20failed%0A-%20Execution%20of%20Project%3A%3Aentrypoints%20failed%0A-%20Execution%20of%20Project%3A%3Aapp_project%20failed%0A-%20Panic%20in%20AppProject%3A%3Anew%3A%20Some%28%22oh%20no%20new%20app%21%22%29%0A%60%60%60&labels=Turbopack,Turbopack%20Panic%20Backtrace) In a terminal without hyperlink support `FORCE_HYPERLINK=0 pnpm next dev --turbo examples/basic-css/`: ``` ----- FATAL: An unexpected Turbopack error occurred. A panic log has been written to /var/folders/sk/zy7023wd30j0dxpmdv3nylm80000gn/T/next-panic-3c5a833c682727cba1d51cc97ee0c16.log. To help make Turbopack better, report this error by clicking here: https://github.com/vercel/next.js/discussions/new?category=error-report&title=Turbopack%20Error%3A%20Panic%20in%20AppProject%3A%3Anew%3A%20Some%28%22oh%20no%20new%20app%21%22%29&body=Error%20message%3A%0A%60%60%60%0ATurbopack%20Error%3A%20Panic%20in%20AppProject%3A%3Anew%3A%20Some%28%22oh%20no%20new%20app%21%22%29%0A%60%60%60&labels=Turbopack,Turbopack%20Panic%20Backtrace ----- ```
1 parent 910b07b commit aaad3da

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Cargo.lock

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/napi/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ rustc-hash = { workspace = true }
6767
serde = "1"
6868
serde_json = "1"
6969
shadow-rs = { workspace = true }
70+
supports-hyperlinks = "3.1.0"
71+
terminal_hyperlink = "0.1.0"
7072
tracing = { workspace = true }
7173
tracing-subscriber = { workspace = true }
7274
tracing-chrome = "0.5.0"

0 commit comments

Comments
 (0)