Once this error occurs, the globalbar buttons, like Edit, Preview, Unlock, and Page Information are all non-functional.
I have seen it happen with other templates too, sometimes with the same error happening in page.js
In this particular example, the page template component looks like this:
It will even happen on a very simple static template:
It does not happen on all pages, clearly. But it is happening on this page with this template component. So the other pages must be doing something or loading some library that mine does not.