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: avoid to throw error when link doesn't have parentNode #1016

Merged
merged 5 commits into from Mar 7, 2023

Conversation

VieZhong
Copy link
Contributor

@VieZhong VieZhong commented Feb 14, 2023

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

image
The variable i is a Link tag. But when it loads error, it's parentNode is null. So it will throw an error.

Here is the fix , just like what Alexander does in hmr.
image

Breaking Changes

Additional Info

see this issuse: #1017

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 14, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: VieZhong / name: 钟远维 (08032b1)

src/index.js Outdated
@@ -862,7 +862,7 @@ class MiniCssExtractPlugin {
'err.code = "CSS_CHUNK_LOAD_FAILED";',
"err.type = errorType;",
"err.request = realHref;",
"linkTag.parentNode.removeChild(linkTag)",
"if(linkTag.parentNode) linkTag.parentNode.removeChild(linkTag)",
Copy link
Member

Choose a reason for hiding this comment

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

Please add space after if

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexander-akait I fixed it. Please review again~

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 16, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

snitin315
snitin315 previously approved these changes Feb 20, 2023
Copy link
Member

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

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

LGTM

@VieZhong
Copy link
Contributor Author

I have pushed a commit to fix test case errors. Please approve again! Thx.

@VieZhong VieZhong requested review from snitin315 and alexander-akait and removed request for snitin315 and alexander-akait February 20, 2023 03:19
@codecov
Copy link

codecov bot commented Feb 20, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (cab796f) 90.37% compared to head (9e6409d) 90.37%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1016   +/-   ##
=======================================
  Coverage   90.37%   90.37%           
=======================================
  Files           5        5           
  Lines         831      831           
  Branches      222      222           
=======================================
  Hits          751      751           
  Misses         70       70           
  Partials       10       10           
Impacted Files Coverage Δ
src/index.js 96.30% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@snitin315
Copy link
Member

OLD API tests are failing, can you check?

@VieZhong
Copy link
Contributor Author

OLD API tests are failing, can you check?

I missed testing the old API. And Now I fixed it. Please review the code again.

@VieZhong VieZhong requested review from alexander-akait and snitin315 and removed request for snitin315 and alexander-akait February 20, 2023 07:02
@VieZhong
Copy link
Contributor Author

VieZhong commented Feb 20, 2023

@alexander-akait @snitin315

Do you have the access to merge? Please merge and plubish a new version. Thank you all.

@alexander-akait alexander-akait merged commit 6292440 into webpack-contrib:master Mar 7, 2023
31 checks passed
@alexander-akait
Copy link
Member

Thank you

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.

None yet

3 participants