filipesilva / angular-quickstart-lib

MIT License
305 stars 75 forks source link

Unexpected value 'LibModule' imported by the module 'AppModule' #54

Closed mina-skunk closed 7 years ago

mina-skunk commented 7 years ago

npm run build cd .\dist npm link

From @angular/cli@1.3.2 project add: src/tsconfig.app.json

  "paths": {
      "@angular/*": [
        "../node_modules/@angular/*"
      ]
    }

src/app/app.module.ts

import { LibModule } from 'quickstart-lib';
...
  imports: [
    BrowserModule,
    LibModule
  ],
...

npm link quickstart-lib npm start or ng serve --preserve-symlinks

Unexpected value 'LibModule' imported by the module 'AppModule'. Please add a @NgModule annotation.

baruchvlz commented 7 years ago

You can see here that the name of the package is quickstart-lib and not lib. (unless you changed it).

Try doing import { LibModule } from 'quickstart-lib'

mina-skunk commented 7 years ago

@baruchvlz That was a typo sorry, if so the error would be:

Cannot find module 'lib'.

It is just working now though so closing.