All posts

I upgraded DOMPurify, so why did I end up fixing happy-dom?

, 17 min, testing, dompurify, happy-dom

After deleting pnpm-lock.yaml and reinstalling, caret-range packages all jumped at once and sanitize tests broke. I isolated them one by one and pinned DOMPurify as the culprit, but the same version was fine on jsdom. Here is how I separated the version from the environment and traced it down to the root cause.

On this page8
  1. All I did was delete the lockfile
  2. Two strange failures
  3. Same version, different environment
  4. The chain that turns tagName into an empty string
  5. A defense born from not being able to trust the instance
  6. The direction a silent failure heads
  7. So where did I fix it?
  8. Wrapping up