tb / ng2-nouislider

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

Error while building an application with Angular 6 and AOT #172

Closed benoitbzl closed 6 years ago

benoitbzl commented 6 years ago

Hi, my angular project includes ng2-nouislider as an external module. The project uses angular CLI for the build process. It worked fine with Angular 5.x. I am switching my project to angular 6 and the AOT build is now producing the error:

ERROR in ./node_modules/ng2-nouislider/src/ng2-nouislider.ts Module build failed: Error: ...\node_modules\ng2-nouislider\src\ng2-nouislider.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (...\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:709:23) at plugin.done.then (...\node_modules\@ngtools\webpack\src\loader.js:41:31) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) If I delete the file ng2-nouislider.ts from the package module, this seems to fix the error. I tried to exclude the file using the tsconfig.json without any luck (it does not seem possible to exclude files from node_modules directory as per typescript documentation).

alexthelion commented 6 years ago

I'm getting the same error:

ERROR in ./node_modules/ng2-nouislider/src/ng2-nouislider.ts Module build failed: Error: /tmp/build_7a7a3fdfd858dc4cf1233043ff6a9d79/node_modules/ng2-nouislider/src/ng2-nouislider.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (/tmp/build_7a7a3fdfd858dc4cf1233043ff6a9d79/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:709:23) at plugin.done.then (/tmp/build_7a7a3fdfd858dc4cf1233043ff6a9d79/node_modules/@ngtools/webpack/src/loader.js:41:31) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)

marshallcool commented 6 years ago

Error: /app/node_modules/ng2-nouislider/src/ng2-nouislider.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. help

mkp05 commented 6 years ago

Seems like fixing file-name error in my friday commit revealed another misconfiguration of the package... Working on fixing also this.

mkp05 commented 6 years ago

QFix in PR. I'm so sorry for inconvenience - just wanted to fix another bug too fast... :( I think I've searched all the files for other old-filename leftovers.

@tb If I have some free time maybe I will try to propose little change in folder structure based on bigger libraries that will allow to publish to npm both dist files (and not keep them in repository) and sources and have everything work both in JIT and AOT. I have few changes already, but need time to verify them.

gustavo-peralta commented 6 years ago

Solutio,

On package.json Force the previous version "ng2-nouislider": "1.7.9",

Execute npm i to update de dependecies.

And now you can compile AOT build.

tb commented 6 years ago

Thanks @mkp05 for fix, its released as 1.7.11