-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 bail not being defined for the vite builder #19405
Fix bail not being defined for the vite builder #19405
Conversation
This looks good, but let's see how #19406 plays out, because we might not need this change. |
@joshwooding @IanVS in #19406 I agreed with @ndelangen that we would keep the So in short, we'll keep |
|
||
export async function bail(e?: Error): Promise<void> { | ||
try { | ||
return await server.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: In theory server
can be undefined
here - although I can't see if it can in practice right now.
To be defensive I'd change the type to be let server: ViteDevServer | undefined;
and add optional chaining when using it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you want that in order to avoid the console warning? (this is in a try/catch.) I think it might be nice to show it, so we know what's happening, but it's also not super actionable, so I could go either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm good point, I actually have no strong preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered this but I chose to leave it unguarded so that it would throw and error.
…ned-for-vite-builder
Issue: #19349
Equivalent to storybookjs/builder-vite#510
What I did
How to test
If your answer is yes to any of these, please make sure to include it in your PR.