Read the warnings about executing JS code in the Browser object manual entry. In particular:
[quote:3rwvy0dw]By default, code is minified on export. If you do not write Javascript that is compatible with Google Closure Compiler's ADVANCED mode, it may be broken and crash the game after export.
After minify, the runtime code is mangled so names like getObjectByUID are shortened to unpredictable strings like "xf". It doesn't look in strings though, so that action is broken.