-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
feat: export error message generator #11155
feat: export error message generator #11155
Conversation
a332c02
to
cc56bf5
Compare
cc @Princesseuh who has been championing Astro's error handling recently. I'm not sure if this would be useful for Astro but could be interesting for other cases. |
For reference, we discussed with @manucorporat about improvements to our error messages that doesn't require exporting this function. But these may take some time to iron out so I think exporting this util is a good move for the mid-term to let frameworks have a consistent error story with Vite. |
If the goal is to standardize error message handling, should we also document this in api-javascript so it gets more awareness? I don't have experience with error handling outside of the plugin lifecycle so I don't have much comments on whether this is a good idea or not 😬 |
Confirming that for Astro this is not useful, we do all the printing ourselves in the CLI for all kinds of errors. I can see why other frameworks would find it interesting to have though! |
Reason for us is to leverage Vite DX, and not reinvent the well, of course every framework could build their own, but i feel if all efforts go into vite, all of us win. The reason for this PR is that there are more errors and warnings than crashes or plugin errors. |
I think we should merge this. Discussed with Evan too, and he thinks we should be careful moving forward about exporting more utilities. In this case, I agree that for some frameworks this is going to be helpful with a small maintenance cost for us (and Manu is interested in helping on Vite's error story in general, so it is also better that the fixes and improvement go directly to us and not stay downstream). |
Description
Exports the
buildErrorMessage()
util, to be able to implement nice printed error and warning outside the rollup pipeline.Additional context
Discussion with @patak-dev
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).