Discourse API 이벤트에서 스크립트가 실행되지 않음 (Discourse OOPS 페이지)

안녕하세요

onAppEvent, decorateWidget, onPageChange 등의 Discourse API 이벤트에 커스텀 JavaScript를 작성했습니다. 위 API 이벤트는 Discourse 페이지에서 정상적으로 작동합니다. 하지만 해당 Discourse API 이벤트는 “OOPS” 페이지에서 스크립트를 실행하지 못했습니다. 그래서 아래 코드를 사용하여 자체 Discourse API 이벤트를 만들어 실행해 보았습니다.

<script type="text/discourse-plugin" language="javascript">
   if (!('Discourse' in window)) {
        window.Discourse = {};
    }
    if ('Discourse' in window && !('_registerPluginCode' in window.Discourse)) {
        // Make this a noop
       
        window.Discourse._registerPluginCode = function() {};
        // Our scripts
}
</script>

위 스크립트를 시도해 보니 “Uncaught TypeError: Cannot read property ‘lookup’ of undefined” 라는 오류가 발생합니다. Discourse에서 테마를 가져오는 과정에서 왜 실패하는지 알 수 없습니다.

아래 스크린샷을 참고해 주세요.

OOPS 페이지에서 커스텀 스크립트를 실행하기 위해 위 오류를 어떻게 해결할 수 있을까요?