asotog / squeezebox

Simple Angular 2 accordion component
19 stars 8 forks source link

Angular CLI error: ERROR in ./node_modules/squeezebox/index.ts #18

Closed pr0menade closed 6 years ago

pr0menade commented 6 years ago

Angular CLI - 1.6.0 Angualr - ~5.1.0

ERROR in ./node_modules/squeezebox/index.ts
Module build failed: Error: ~/../node_modules/squeezebox/index.ts is not part of the compilation output. Please check the other error messages for details.
    at AngularCompilerPlugin.getCompiledFile (~/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:648:23)
    at plugin.done.then (~/.../node_modules/@ngtools/webpack/src/loader.js:467:39)

app.module.ts

import {SqueezeBoxModule} from 'squeezebox';

 imports: [ SqueezeBoxModule]

Can you, please add additional information how to add Squeezebox to Angular CLI properly.

asotog commented 6 years ago

will try angular cli and let you know by today or tomorrow, pls stay tuned

ghost commented 6 years ago

I got this:

ERROR in ./node_modules/squeezebox/index.ts Module build failed: Error: {My Path}\node_modules\squeezebox\index.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 ({my path}\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:674:23) at plugin.done.then ({my path}\node_modules\@ngtools\webpack\src\loader.js:467:39) at process._tickCallback (internal/process/next_tick.js:109:7)

PS: This solved my problem, maybe it will help.

https://github.com/angular/angular-cli/issues/9142

I added this to the tsconfig.json so that it could reach the squeezebox ts. After that i bumped again into the exact same problem, with my main.ts and polyfill.ts files, so i added ./src/*. and it worked.

"include": [
    "./src/**/*",
    "./node_modules/squeezebox/**/*",
  ]
asotog commented 6 years ago

@mszpereira thanks working on integrating angular package format, stay tuned guys @pr0menade

asotog commented 6 years ago

please check squeezebox 1.4.0, now in order to import the module you have to do :

import {SqueezeBoxModule} from 'squeezebox/dist';
asotog commented 6 years ago

https://github.com/asotog/squeezebox/commit/f458a8937d65201ff27de55d804f16358f132c73 https://github.com/asotog/squeezebox/commit/927ebc54bfdc998b392f5bffb83864e2744aff15 https://github.com/asotog/squeezebox/commit/d17f8d848b2032d9ce07574d5f7c74b346b1537d