It seems that the JS files are loaded asynchronously so the JS file containing the context class has not been loaded yet when it was referenced (loading should consider references, though).
After a few swaps of the loaded <script>
lines, it has been resolved.