Repository navigation
docs: fix searchbox spinning forever after Docusaurus upgrade - #25064
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The baycloud cookie-consent script (cl.js) monkey-patches window.Worker
and calls .includes() / .replace() on the URL argument assuming it is
always a string. @easyops-cn/docusaurus-search-local 0.52 instantiates
its worker with `new Worker(new URL("./worker.js", import.meta.url))`,
passing a URL object — which makes baycloud throw "TypeError: t.includes
is not a function" and leaves the search dropdown spinning forever.
Move the baycloud tag from scripts[] into headTags[] so we control
ordering, then add an inline Proxy on window.Worker right after it that
coerces non-string URL args via .toString() before delegating to
baycloud's wrapper. The consent script still loads sitewide as before;
only the URL/string incompatibility is neutralized, so search works
without downgrading the plugin.
Fixes bigbluebutton#25009.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|



What does this PR do?
tl;dr: The searchbox of docs.bigbluebutton.org was not producing results.
The baycloud cookie-consent script (cl.js) monkey-patches window.Worker and calls .includes() / .replace() on the URL argument assuming it is always a string. @easyops-cn/docusaurus-search-local 0.52 instantiates its worker with
new Worker(new URL("./worker.js", import.meta.url)), passing a URL object — which makes baycloud throw "TypeError: t.includes is not a function" and leaves the search dropdown spinning forever.Move the baycloud tag from scripts[] into headTags[] so we control ordering, then add an inline Proxy on window.Worker right after it that coerces non-string URL args via .toString() before delegating to baycloud's wrapper. The consent script still loads sitewide as before; only the URL/string incompatibility is neutralized, so search works without downgrading the plugin.
Closes Issue(s)
Closes #25009