tb / ng2-nouislider

Angular2 noUiSlider directive
http://tb.github.io/ng2-nouislider/
MIT License
184 stars 114 forks source link

New update broke angular-cli @1.6.2 -> @1.7.0 #113

Closed azarus closed 7 years ago

azarus commented 7 years ago

ng2-nouislider@1.6.2 works with angular cli 1.4.2 ng2-nouislider@1.7.2 no longer works with angular cli 1.4.2

Command: ng build --prod produces error:

ERROR in Error: Unexpected value 'NouisliderModule in D:/Projects/frontend/node_modules/ng2-nouislider/src/nouislider.js' declared by the module 'UIModule in D:/Projects/frontend/src/ui.module.ts'. Please add a @Pipe/@Directive/@Component annotation.
    at Error (native)
    at syntaxError (D:\Projects\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:1729:34)
    at D:\Projects\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:15625:40
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (D:\Projects\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:15607:54)
    at addNgModule (D:\Projects\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:24403:58)
    at D:\Projects\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:24414:14
    at Array.forEach (native)
    at _createNgModules (D:\Projects\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:24413:26)
    at analyzeNgModules (D:\Projects\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:24288:14)
    at analyzeAndValidateNgModules (D:\Projects\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:24298:35)
    at AotCompiler.analyzeModulesAsync (D:\Projects\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:23932:46)
    at CodeGenerator.codegen (D:\Projects\frontend\node_modules\@angular\compiler-cli\src\codegen.js:32:14)
    at Function.NgTools_InternalApi_NG_2.codeGen (D:\Projects\frontend\node_modules\@angular\compiler-cli\src\ngtools_api.js:73:30)
    at _donePromise.Promise.resolve.then (D:\Projects\frontend\node_modules\@ngtools\webpack\src\plugin.js:386:44)

Code:

import { NouisliderModule } from 'ng2-nouislider';

@NgModule({
    imports: [
        NouisliderModule
    ],
    declarations: [
    ],
    providers: [

    ],
    exports: [

    ]
})
export class UIModule {
    constructor()
    {

    }
}

Tried declaratiors, providers and exports and so on.

tb commented 7 years ago

Yes, 1.7.x are broken and I was not able to fix it so far. I requested unpublish of 1.7.0, use 1.6.x.

AoT errors are not visible on current demo, this package should use angular-cli so that we can test it.

I think good starting point would be to setup it like this https://medium.com/@ngl817/building-an-angular-4-component-library-with-the-angular-cli-and-ng-packagr-53b2ade0701e

azarus commented 7 years ago

Thanks. I downgraded and specified fixed version for my deployments so far. Let me know once a new version is available. Thank you.