This project is read-only.

Syntax Highlighter conflict - BlogEngineRes is not defined

Topics: Business Logic Layer, Themes
Jan 2, 2013 at 9:04 PM

I've got a strange issue; can't say when it happened, but it was present in and is still present in 2.7

Syntax Highlighting is not working, for a particular theme. It works if I choose the Indigo theme, but not if I choose the Interlude theme. The error is an "Uncaught ReferenceError: BlogEngineRes is not defined", which occurs in highlighter.js  

I have taken a look at the site.master files for both themes and cannot see any reason why there should be any difference, it feels like a JavaScript conflict, but I can't see what's causing it. Can anyone explain it to me

Jan 3, 2013 at 8:15 PM

OK figured it out, but the answer is surprising.

Turning off Advanced settings > Enable optimization in the Interlude theme resolved the issue. This isn't necessary for the Indigo theme. 

I am curious though, presumably this means that the compression / minification (that is recommended) is not safe, I would like to know how the conflict arises - so I can do something about it and fix the Interlude theme

Jan 3, 2013 at 9:56 PM

This probably because optimization chocked trying to minify script. Usually if you go directly to optimized script URL (something like "") you should see error in there. I had to fix syntax for several scripts in extensions I'm using, JS parser ignores these errors but optimization DLL throws an error and it has to be fixed.