FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: add error handling to transform for Rspack and webpack by chenjiahan · Pull Request #482 · unjs/unplugin · GitHub

/ unplugin Public

fix: add error handling to transform for Rspack and webpack - #482

Merged
sxzz merged 2 commits into
unjs:mainfrom
chenjiahan:transform_error_handle_0321
Mar 21, 2025
Merged

fix: add error handling to transform for Rspack and webpack#482
sxzz merged 2 commits into
unjs:mainfrom
chenjiahan:transform_error_handle_0321

Conversation

Copy link
Copy Markdown
Contributor

Description

Add error handling for the plugin's transform in the Rspack loader.

Wrapping the plugin.transform.call() in a try-catch block to ensure that any errors thrown during the transformation process are properly captured and passed to Rspack's error handling mechanism.

I made the same changes to the webpack loader to keep it consistent.

Related issues

resolve web-infra-dev/rsbuild#4789

Preview

  • dev without try...catch (process exit):

  • dev with try...catch (the error is emit by Rspack and this did not break the dev build):

pkg-pr-new Bot commented Mar 21, 2025

Copy link
Copy Markdown

Open in Stackblitz

npm i https://pkg.pr.new/unjs/unplugin@482

commit: 7e2bf22

sxzz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

sxzz merged commit 8e08ebe into unjs:main Mar 21, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the quick response ❤️

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Dev server crashes when editing files

2 participants


Back | FazBrowse Home | New Git URL