mini-css-extract-plugin icon indicating copy to clipboard operation
mini-css-extract-plugin copied to clipboard

fix: safer removeChild by checking parent node

Open encloinc opened this issue 5 months ago • 2 comments

This PR contains a:

  • [+ ] bugfix
  • [ ] new feature
  • [ ] code refactor
  • [ ] test update
  • [ ] typo fix
  • [ ] metadata update

Motivation / Use-Case

I got fed up with nextjs throwing this error:

runtime Error


Error: Cannot read properties of null (reading 'removeChild')

Call Stack
1

Hide 1 ignore-listed frame(s)
HTMLLinkElement.eval
node_modules\next\dist\compiled\mini-css-extract-plugin\hmr\hotModuleReplacement.js (1:1137)

So I patched the minified file to check if parentNode is null (which fixed the issue) and im uploading the patch here.

Breaking Changes

Additional Info

encloinc avatar Jun 19 '25 06:06 encloinc

CLA Not Signed

Thanks for the contribution ❤️ ! Could you sign the CLA?

evenstensberg avatar Jun 19 '25 18:06 evenstensberg

Fixed in the main

alexander-akait avatar Aug 11 '25 15:08 alexander-akait