Reputation: 15558
For example (even trying to use the library from console after X seconds or with a setTimeout):
client/kiwi.mini.js (from https://github.com/gamelab/kiwi.js)
Exception from Tracker afterFlush function: debug.js:41 ReferenceError: Kiwi is not defined
When kiwi is loaded standalone with
<script src
within a normal HTML page, it just works (new Kiwi...)
Upvotes: 0
Views: 60
Reputation: 4703
The last little bit of the huge unminified JS file is minified, so it's hard to tell for sure, but it doesn't look like Kiwi
is being added to the window
object in their code. Since Meteor compiles all JS files and makes any variable that has a var
in front of it local to that JS file, the Kiwi object is not available globally.
Simply add one line of code to the end of the minified file:
window.Kiwi = Kiwi;
I've tested it in a sample Meteor app and was able to create a new Kiwi.Game
object.
Upvotes: 1