fulls1z3/ngx-meta

export 'Meta' was not found in '@angular/platform-browser'

Closed this issue · 1 comments

I have one angular-cli generated project where I want to use dynamic metadata for a page. I went ahead and used this module but its giving me the following issue.

WARNING in ./~/@nglibs/meta/src/meta.service.js
212:12-16 "export 'Meta' was not found in '@angular/platform-browser'

ERROR in /Users/<USERNAME>/projects/apps/business-template/open-business-webpage/node_modules/@nglibs/meta/src/meta.service.d.ts (1,10): Module '"/Users/<USERNAME>/projects/apps/business-template/open-business-webpage/node_modules/@angular/platform-browser/index"' has no exported member 'Meta'.
webpack: Failed to compile.

I am not using systemjs.config.

Current behavior
It is unable to find Meta class on @nglibs/meta/src/meta.service.js

Expected/desired behavior
It should allow the application to run successfully.

Minimal reproduction of the problem with instructions

  • Start a new project using angular-cli 1.0.0-beta.28.3
  • Add nglibs/meta package to your package.json
  • Run npm install
  • Add import { MetaModule, MetaLoader } from '@nglibs/meta'; on your app.module.ts.
  • Add MetaModule.forRoot({ provide: MetaLoader }), on imports of app.module.ts
  • Run ng serve

Please tell us about your environment:

  • darwin x64

  • IntelliJ 2017.1

  • Node 6.9.5

  • Angular version: 2.4.10

  • Browser: Chrome

  • Language: TypeScript

  • Node (for AoT issues): node --version = 6.9.5

Hi @phoenixTW you're using v0.4.0-rc.1 on Angular 2 and you better should set the version in your package.json to 0.2.0-rc.5.

Angular 4 contains a generic Meta service whereas Angular 4 does't. The v0.2.x branch contains these helpers that Angular 4 provides natively.

I think fixing the version on your package.json would solve your problem. You can find this information on README.md too.