Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bundling): show codeframes for Rollup build errors #22845

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Apr 16, 2024

This PR prints out more useful information for when Rollup builds fail. Currently, only the error message is printed, which is just a stacktrace such as:

    at Object.wrapException (/Users/jack/projects/acme5/node_modules/sass/sass.dart.js:2184:43)
    at SpanScanner.error$3$length$position (/Users/jack/projects/acme5/node_modules/sass/sass.dart.js:79737:15)
    at SpanScanner._fail$1 (/Users/jack/projects/acme5/node_modules/sass/sass.dart.js:79862:12)
    at SpanScanner.expectChar$2$name (/Users/jack/projects/acme5/node_modules/sass/sass.dart.js:79818:12)
    at SpanScanner.expectChar$1 (/Users/jack/projects/acme5/node_modules/sass/sass.dart.js:79821:19)
    at ScssParser0.children$1 (/Users/jack/projects/acme5/node_modules/sass/sass.dart.js:107462:10)

We also need to print the formatted message from Rollup, which would point to the actual source of the error. For example, for SASS errors it will show:

Error: expected "{".
  ╷
9 │ >container }
  │            ^
  ╵
  ui/src/lib/ui.module.scss 9:12  root stylesheet

Current Behavior

Errors are not as useful.

Expected Behavior

Show more useful errors.

Related Issue(s)

Fixes #

@jaysoo jaysoo requested a review from a team as a code owner April 16, 2024 20:11
@jaysoo jaysoo requested a review from JamesHenry April 16, 2024 20:11
Copy link

vercel bot commented Apr 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Apr 16, 2024 8:11pm

@jaysoo jaysoo merged commit 3ca5c78 into master Apr 16, 2024
6 checks passed
@jaysoo jaysoo deleted the rollup_error_codeframes branch April 16, 2024 20:39
AgentEnder pushed a commit to AgentEnder/nx that referenced this pull request Apr 23, 2024
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants