-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Conversation
|
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)", |
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.
Please add space
after if
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.
@alexander-akait I fixed it. Please review again~
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.
LGTM
I have pushed a commit to fix test case errors. Please approve again! Thx. |
Codecov ReportPatch and project coverage have no change.
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
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. |
OLD API tests are failing, can you check? |
I missed testing the old API. And Now I fixed it. Please review the code again. |
Do you have the access to merge? Please merge and plubish a new version. Thank you all. |
Thank you |
This PR contains a:
Motivation / Use-Case
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.

Breaking Changes
Additional Info
see this issuse: #1017