Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Livereload not working on components in root folder (Angular 5 & Cli 1.7) #287

Open
fabriziodebortoli opened this issue Mar 20, 2018 · 0 comments

Comments

@fabriziodebortoli
Copy link

With latest Angular Cli versions, with a npm linked library (or local library imported by "file:..." in package.json), I received the error:

ERROR in ./node_modules/yourlibrary/index.ts
Module build failed: Error: C:\linktest\linkapp\node_modules\yourlibrary\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 (C:\linktest\linkapp\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:674:23)
    at plugin.done.then (C:\linktest\linkapp\node_modules\@ngtools\webpack\src\loader.js:467:39)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

webpack: Failed to compile.

solved updating tsconfig.app.json with this configuration:

"compilerOptions": {
   ...
     "paths": {
         "yourlibrary": [
             "../node_modules/yourlibrary"
         ]
     }
 },

After a ng serve, updating a component under a folder, app reload library correctly.
Updating a component in src folder of library, server doesn't refresh.

My environment

Angular CLI: 1.7.3
Node: 8.9.4
OS: win32 x64
Angular: 5.2.9

RePro

I created an example repo: https://github.com/fabriziodebortoli/linklibrary.git with a new ng app and a new library generated

In linkapp folder, after a npm i, can test app with ng serve and try to update sample.component.ts or folder/sample2.component.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant