Suppose I have a small web application and want to use a third-party library that comes with an already compiled version of ClojureScript.
As a user of this library, I have to include this generated Javascript file in my HTML page.
<script src="/javascript/gen/lib.js" type="text/javascript">
So far so good. Everything is working fine.
But since my web application needs some kind of external magic, I wanted to include my own ClojureScript. So I wrote a couple of lines, compiled them in Javascript and added another line in the HTML header:
<script src="/javascript/gen/lib.js" type="text/javascript"> <script src="/javascript/gen/my-stuff.js" type="text/javascript">
This is where it gets ugly. I get this error in javascript console:
Error: Namespace "goog.debug.Error" already declared.
After an error in this error, I get several pages that claim that I cannot use several Google Closure Compiled things on one page. See SO: Multiple ClojureScript Files on One Page
So how do I solve this situation? On the one hand, I already have a Google Closure compiled lib, and on the other, my ClojureScript stuff. How can I get one (or two) compiled Javascript files?
Would it be easier if this third-party lib provided an uncompiled version of ClojureScript?
source share