I am writing some unit tests for my component and i am getting this cryptic error message. I found a similar question at Angular 2 unit testing - getting error Failed to load
I encountered the same issue using angular-cli 6, so to get the right error message one should use the following:
ng test --source-map=false
Maybe it will help someone :) .