When using OctoberCMS as a SPA (Single Page Application), it changes the page and the html markup for each page using purely ajax. Because the registration of HtmlCompressTwig is preserved if a page is not reloaded, it throws an error (screenshot below).
This is a fix for this that adds a condition to check whether HtmlCompressTwig is already registered before trying to add it.
When using OctoberCMS as a SPA (Single Page Application), it changes the page and the html markup for each page using purely ajax. Because the registration of HtmlCompressTwig is preserved if a page is not reloaded, it throws an error (screenshot below).
This is a fix for this that adds a condition to check whether HtmlCompressTwig is already registered before trying to add it.