You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LingyuCoder
changed the title
fix: should not fail when pass null to additional data of async loader context
fix: should not fail when pass null to additional data of loader context
Apr 24, 2025
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request addresses an issue where passing a null value to the additionalData parameter of the async loader context causes the process to fail. It fixes the assignment in the loader runner and adds a new test case to verify that null values are handled properly.
Changed the assignment of context.additionalData in loader-runner to safely handle null values.
Added test cases and configuration updates in the rspack-test-tools package to confirm the fix.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File
Description
packages/rspack/src/loader-runner/index.ts
Modified additionalData assignment to prevent failures when null is passed
LingyuCoder
changed the title
fix: should not fail when pass null to additional data of loader context
fix: pass null to additional data of loader context
Apr 24, 2025
I don't quite get this issue. Would you please point me out the exact case we're after? I can't grab much information from the test case in this PR.
@h-a-n-a The val-loader will pass null to loaderContext.additionalData and null can not be transform from node binding (only accept undefined as empty value) which leads to the error of that issue.
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
release: bug fixrelease: bug related release(mr only)teamThe issue/pr is created by the member of Rspack.
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix #9635
same as https://github.com/web-infra-dev/rspack/blob/main/packages/rspack/src/loader-runner/index.ts#L1023
Checklist