webpack-contrib / mini-css-extract-plugin

Lightweight CSS extraction plugin
MIT License
4.65k stars 389 forks source link

fix: avoid to throw error when link doesn't have parentNode #1016

Closed VieZhong closed 1 year ago

VieZhong commented 1 year ago

This PR contains a:

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: https://github.com/webpack-contrib/mini-css-extract-plugin/issues/1017

linux-foundation-easycla[bot] commented 1 year ago

CLA Signed

The committers listed above are authorized under a signed CLA.

linux-foundation-easycla[bot] commented 1 year ago

CLA Signed

The committers listed above are authorized under a signed CLA.

VieZhong commented 1 year ago

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

codecov[bot] commented 1 year ago

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 ```diff @@ 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](https://codecov.io/gh/webpack-contrib/mini-css-extract-plugin/pull/1016?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webpack-contrib) | Coverage Δ | | |---|---|---| | [src/index.js](https://codecov.io/gh/webpack-contrib/mini-css-extract-plugin/pull/1016?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webpack-contrib#diff-c3JjL2luZGV4Lmpz) | `96.30% <ø> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webpack-contrib). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webpack-contrib)

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

snitin315 commented 1 year ago

OLD API tests are failing, can you check?

VieZhong commented 1 year ago

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 commented 1 year ago

@alexander-akait @snitin315

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

alexander-akait commented 1 year ago

Thank you