duckduckgo / duckduckgo/content-scope-scripts
Impacting Wikimedia sites: NotFoundError: Node.removeChild: The node to be removed is not a child of this node
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 70
- Forks
- 35
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 40
Description
Hi there!
I work at the Wikimedia Foundation and we've been seeing about 20k errors a week due to a mysterious bug that we believe might relate to your code. The issue is tricky for us to filter out as the file URI associated with the errors does not correspond with any browser extension URL so I was wondering if you could help us by finding a way to either fix the problem or allow us to filter it more successfully.
The bug appears as NotFoundError: Node.removeChild: The node to be removed is not a child of this node or NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. and the stack trace if often empty or if we're lucky:
at remove
at jQuery.fn.init.remove
at DDGRuntimeChecks.callback
at DDGRuntimeChecks.dispatch at elemData.handle
The issue mostly impacts commons.wikimedia.org file pages e.g.
https://commons.wikimedia.org/wiki/File:Rectangle_%28plain%29.svg or https://commons.wikimedia.org/wiki/File:Mistelbach_Brunnen-20230514-RM-161753.jpg
Any idea what could be happening here?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the NotFoundError on the Wikimedia Commons file pages named in the report and inspect the stack entries for remove, jQuery.fn.init.remove, and DDGRuntimeChecks.callback. Trace which node-removal path produces the error, then verify that the resulting change either prevents the error or makes it filterable; the report provides no named source file or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, jquery
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100