What were the changes you made prior to the problem occurring?
You may need to disable all add-ons, remove any custom JavaScript and revert to an unedited, default template.
Then re-enable each add-on in turn until the error is triggered, to identify which one it is.