wannabegeek / ng2-split-pane

Split View module for Angular 2
MIT License
43 stars 25 forks source link

Angular2 Module Errors #7

Closed senften closed 7 years ago

senften commented 7 years ago

I installed ng2-split-pane with npm.

I have the following app.module.ts file.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';

import { TreeModule } from 'angular2-tree-component';
//import { SplitPaneModule } from 'ng2-split-pane'
import { SplitPaneModule } from 'ng2-split-pane/lib/ng2-split-pane'

import { AppComponent } from './app.component';
import { MulticanvasComponent } from './multicanvas/multicanvas.component';

@NgModule({
  declarations: [
    AppComponent,
    MulticanvasComponent
  ],
  imports: [
    `BrowserModule,`
    FormsModule,
    HttpModule,
    TreeModule,
    SplitPaneModule
  ],
  exports: [
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

which start from angular-cli tooling. If I use the above code, when I build I get an error stating SplitPaneModule is not an NgModule

> ng build You are running version 6.7.0 of Node, which will not be supported in future versions of the CLI. The official Node version that will be supported is 6.9 and greater.

To disable this warning use "ng set --global warnings.nodeDeprecation=false".Hash: 92794652e3dd6a6a9c27 Time: 6352ms chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 148 kB {5} [initial] [rendered] chunk {1} main.bundle.js, main.bundle.map (main) 21.4 kB {4} [initial] [rendered] chunk {2} scripts.bundle.js, scripts.bundle.map (scripts) 1.18 MB {5} [initial] [rendered] chunk {3} styles.bundle.js, styles.bundle.map (styles) 10 kB {5} [initial] [rendered] chunk {4} vendor.bundle.js, vendor.bundle.map (vendor) 4.17 MB [initial] [rendered] chunk {5} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]

ERROR in SplitPaneModule is not an NgModule

If I uncomment the import { SplitPaneModule } from 'ng2-split-pane' (which is, I believe the intended path), I get the following error

ERROR in [path deleted]/src/app/app.module.ts (9,33): Cannot find module 'ng2-split-pane'.)

It's not clear to me if I've got something wrong or if there is a problem in the distribution. It is also possible it is in the angular-cli webpacking.

siovene commented 7 years ago

Hi, I need to do the same in angular-seed, ie import { SplitPaneModule } from 'ng2-split-pane/lib/ng2-split-pane';. I believe it's an error in packaging on this repository.

wannabegeek commented 7 years ago

Yes, there looks to be a packaging issue with the latest release. I'll get another release out later today.

d-theo commented 7 years ago

Hi, is that "normal" that import { SplitPaneModule } from 'ng2-split-pane/lib/ng2-split-pane';

is throwing a Cannot find module 'ng2-split-pane' ?

siovene commented 7 years ago

@wannabegeek any ETA for the new release? I need it because of the ES5 support that I submitted as a PR and that you merged.

wannabegeek commented 7 years ago

Sorry for the delay, I released another version a few days ago.