Troubleshoot
Troubleshooting Runtime Problems
When using Flytrap, you might in rare cases encounter problems during runtime. These are problems and solutions to possible runtime errors.
Cannot access ‘functionName’ before initialization
If you havent disabled Flytrap’s default function hoisting behavior in the Flytrap config, this error shouldn’t happen. If it does, open an issue.
If you have disabled Flytrap’s default hoisting behavior, then the above error can happen.
Solution
You can either enable Flytrap’s hoisting behavior, or move all invocations of function declarations (eg. function foo()
) to be used after the functions are declared.
For example:
Should be rewritten as: