Skip to content

Cannot use linked lib in ejected cli project #5049

Closed
@Dinistro

Description

@Dinistro

OS?

Ubuntu 16.04

Versions.

@angular/cli: 1.0.0-rc.0 (e)
node: 7.5.0
os: linux x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 2.4.8
npm: 4.1.2

Repro steps.

  1. Clone an ng-bootstrap and link it:
git clone https://github.com/ng-bootstrap/ng-bootstrap.git
cd ng-bootstrap
gulp build
cd dist/
npm link
  1. Create new cli project and execute ng eject
  2. Link ng-bootstrap into your new project:
npm link @ng-bootstrap/ng-bootstrap 
  1. Import the NgbModule in the app.module.ts:
...
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    ...,
    NgbModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

  1. Execute npm start

The log given by the failure.

In the browsers console, you will see an error like this:

Error: Unexpected value '[object Object]' imported by the module 'AppModule' ...

Mention any other details that might be useful.

After some debugging, I noticed, that ng-bootstrap was bundled in the main.bundle.js and not in the vendor.bundle.js. It's peerDependencies were as well in the main.bundle.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions