Recently i've bumped into a problem that an external javascript, declared in the html, which is then @Templated by a Java class using Errai UI, doesn't work. The issue might be easy for experienced ones, however, i'm going to describe the solution here as i've spent really a lot time on this.