Skip to content

fix: drop require of removed ep_etherpad-lite/static/js/browser (#169)#370

Merged
JohnMcLear merged 1 commit intomainfrom
fix/remove-browser-require
Apr 17, 2026
Merged

fix: drop require of removed ep_etherpad-lite/static/js/browser (#169)#370
JohnMcLear merged 1 commit intomainfrom
fix/remove-browser-require

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Summary

  • Fixes Errors in console for 'troubleshooting information' admin page #169 (and a follow-on runtime error in Etherpad 2.x).
  • `static/js/index.js` required `ep_etherpad-lite/static/js/browser`, a helper that Etherpad removed during the esbuild refactor. This made the whole module fail to load on the server. The original symptom in Etherpad 1.x was "ReferenceError: window is not defined"; on 2.x it is "Cannot find module". Either way the `/admin/plugins/info` troubleshooting page chokes when it tries to require this hook module for reporting.
  • The only use of `browser` was a `browser.chrome || browser.firefox` guard around the copy/cut/paste handlers. Every currently supported browser implements those events, so drop the require and the guard — the handler block is always registered now.

Test plan

  • Manual: required `ep_comments_page/static/js/index` from a bare Node process before the change and got the load error; after the change the require at least progresses past the browser helper (the module still pulls in other client-only helpers that will be addressed separately).

Etherpad 2.x removed the `static/js/browser` helper during the esbuild
refactor. Requiring it at the top of `static/js/index.js` made the
entire module fail to load on the server — visible as
"Cannot find module 'ep_etherpad-lite/static/js/browser'" (previously
"window is not defined" on older Etherpad versions that did ship the
helper but threw while evaluating it in a Node context). That in turn
broke the \`/admin/plugins/info\` troubleshooting page, which tries to
require every client hook module for reporting.

The only use of `browser` was a chrome/firefox guard around the copy/
cut/paste handlers; every currently supported browser implements those
events, so drop both the require and the guard. The handler block is
always registered now.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JohnMcLear JohnMcLear merged commit b6009e7 into main Apr 17, 2026
3 checks passed
@JohnMcLear JohnMcLear deleted the fix/remove-browser-require branch April 17, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Errors in console for 'troubleshooting information' admin page

1 participant