title: Error: "Encountered undefined provider! Usually this means you have a circular dependencies"
body: <p>Here's a somewhat useless error I'm getting in my Angular / TypeScript application. Until someone makes the error message better, what can we do about this? What are the most likely situations that cause this to happen?</p>
  
  <pre><code>Uncaught Error: Encountered undefined provider! Usually this means you have a circular dependencies (might be caused by using 'barrel' index.ts files.
      at Object.syntaxError 
      at eval     at Array.forEach (native) [&lt;root&gt;]
      at CompileMetadataResolver._getProvidersMetadata 
      at CompileMetadataResolver.getNgModuleMetadata 
      at CompileMetadataResolver.getNgModuleSummary 
      at eval 
  ...
  </code></pre>