title: Unexpected value '...' imported by the module '...'. Please add a @NgModule annotation
body: <p>Using Angular.</p>
  
  <p><strong>Steps:</strong></p>
  
  <ol>
  <li><p>Cloned this simple UI lib that demonstrates the current Angular package standards:  <a href="https://github.com/jasonaden/simple-ui-lib" rel="noreferrer">https://github.com/jasonaden/simple-ui-lib</a></p></li>
  <li><p>Created a new test app with <code>ng new testApp</code></p></li>
  <li><p><code>npm link</code> the <code>simple-ui-lib/dist</code></p></li>
  <li><p><code>npm link simple-ui-lib</code> in the testApp</p></li>
  <li><p>Imported the example module from simple-ui-lib into testApp:</p></li>
  </ol>
  
  <p>In the app.module.ts file:</p>
  
  <pre><code>import { BoxModule } from 'simple-ui-lib';
  
  ...
  
  @NgModule({
    ...
    imports: [
      ...
      BoxModule
    ]
  })
  </code></pre>
  
  <p>Webpack compiles fine, but I get this error in the browser and nothing loads:</p>
  
  <blockquote>
    <p>compiler.es5.js:1540 Uncaught Error: Unexpected value 'BoxModule'
    imported by the module 'AppModule'. Please add a @NgModule annotation.</p>
  </blockquote>
  
  <p><strong>I've tried:</strong></p>
  
  <ul>
  <li>Clearing my npm cache</li>
  <li>Re-installing all node modules</li>
  <li>Forcing all Angular modules to be the same version in both projects</li>
  <li>Checked that all Angular modules are the same version in both projects</li>
  <li>Checked that the TypeScript version is the same in both projects</li>
  <li>Using other sample module packages instead of <code>simple-ui-lib</code></li>
  <li>Created an entirely new project with the same setup</li>
  <li>Downgrading the <code>rollup</code> version used in <code>simple-ui-lib</code> to a build from January</li>
  </ul>
  
  <p>If I console log the <code>BoxModule</code>, I can see the value exists and it seems to be registered as an @NgModule, so I'm confused about what this error is trying to tell me.</p>
  
  <p>I've seen this error around in my searches, but it looks like they are almost always caused by a version mismatch between the library and the host application.  In my case, the versions are the same.</p>
  
  <p><strong>Versions:</strong></p>
  
  <ul>
  <li>TypeScript: 2.2.0</li>
  <li>@angular/cli: 1.0.4</li>
  <li>@angular/common: 4.1.3</li>
  </ul>
  
  <p>Any ideas?</p>
  
  <p><em>Update:</em>  Investigating more, looks like this is a problem with @angular/cli itself.  Opened a bug here:  <a href="https://github.com/angular/angular-cli/issues/6429" rel="noreferrer">https://github.com/angular/angular-cli/issues/6429</a>, but if you have any suggestions please let me know.</p>