Skip to main content

Uncaught SyntaxError Unexpected identifier in UnityScriptsCompiler.js

Error log:

Uncaught SyntaxError: Unexpected identifier in UnityScriptsCompiler.js

This error is likely due o the way JavaScript is parsing the script. Functions defined as expressions in JavaScript need to be declared before being called.

Possible solutions:

  • Move the local function above the handler, or possibly use a lambda expression.
  • Move the definition of an object above the handler.