mareklesko / watch-ng-libraries

CLI to run ng apps using monorepo libraries
MIT License
2 stars 1 forks source link

Error reporting #1

Closed ErickXavier closed 3 years ago

ErickXavier commented 3 years ago

Hi, I'm having an error when the watch-ng-libraries tries to report an error. It's showing this, instead:

C:\Users\username\AppData\Roaming\nvm\v14.17.3\node_modules\@mareklesko\watch-ng-libraries\node_modules\rxjs\internal\util\hostReportError.js:4
    setTimeout(function () { throw err; }, 0);
                             ^

RangeError: Invalid array length
    at C:\Users\USERNAME\AppData\Roaming\nvm\v14.17.3\node_modules\@mareklesko\watch-ng-libraries\lib\logger\logger.js:52:48
    at Array.forEach (<anonymous>)
    at Logger.log (C:\Users\USERNAME\AppData\Roaming\nvm\v14.17.3\node_modules\@mareklesko\watch-ng-libraries\lib\logger\logger.js:51:37)
    at SafeSubscriber._next (C:\Users\USERNAME\AppData\Roaming\nvm\v14.17.3\node_modules\@mareklesko\watch-ng-libraries\lib\logger\logger.js:17:92)
    at SafeSubscriber.__tryOrUnsub (C:\Users\USERNAME\AppData\Roaming\nvm\v14.17.3\node_modules\@mareklesko\watch-ng-libraries\node_modules\rxjs\internal\Subscriber.js:205:16)
    at SafeSubscriber.next (C:\Users\USERNAME\AppData\Roaming\nvm\v14.17.3\node_modules\@mareklesko\watch-ng-libraries\node_modules\rxjs\internal\Subscriber.js:143:22)
    at Subscriber._next (C:\Users\USERNAME\AppData\Roaming\nvm\v14.17.3\node_modules\@mareklesko\watch-ng-libraries\node_modules\rxjs\internal\Subscriber.js:89:26)
    at Subscriber.next (C:\Users\USERNAME\AppData\Roaming\nvm\v14.17.3\node_modules\@mareklesko\watch-ng-libraries\node_modules\rxjs\internal\Subscriber.js:66:18)
    at BehaviorSubject.Subject.next (C:\Users\USERNAME\AppData\Roaming\nvm\v14.17.3\node_modules\@mareklesko\watch-ng-libraries\node_modules\rxjs\internal\Subject.js:60:25)
    at BehaviorSubject.next (C:\Users\USERNAME\AppData\Roaming\nvm\v14.17.3\node_modules\@mareklesko\watch-ng-libraries\node_modules\rxjs\internal\BehaviorSubject.js:51:31)

Environment:

Windows 10 Pro

$ ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/

Angular CLI: 12.2.2
Node: 14.17.3
Package Manager: npm 6.14.13
OS: win32 x64

Angular: 12.2.2
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, material-moment-adapter, platform-browser
... platform-browser-dynamic, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.2
@angular-devkit/build-angular   12.2.2
@angular-devkit/core            12.2.2
@angular-devkit/schematics      12.2.2
@schematics/angular             12.2.2
ng-packagr                      12.2.0
rxjs                            6.6.7
typescript                      4.3.5
mareklesko commented 3 years ago

I will have a look at that meanwhile a quick work around should be to use -v switch, where instead of parsing output a direct ng -compiler output is displayed.

mareklesko commented 3 years ago

@ErickXavier pls. update to v1.2.2. The issue should be resolved. However I did not test it on ANG 12. I tested it on my ANG 11 projects.

ErickXavier commented 3 years ago

@ErickXavier pls. update to v1.2.2. The issue should be resolved. However I did not test it on ANG 12. I tested it on my ANG 11 projects.

Thanks! Done it and testing now.

ErickXavier commented 3 years ago

So, I tested it but it won't report some errors.

Like when I run this line: watch-ng-libraries serve myproject -l @modules/mod1,@modules/mod2,@modules/mod3 -d ./

The terminal gets stuck like this:

[11:05:32 AM] @modules/mod1: Working...
[11:05:29 AM] @modules/mod2 Pending...
[11:05:29 AM] @modules/mod3 Pending...
[11:05:29 AM] myproject Pending...

But if I run the command ng build @modules/mod1 --watch, the error bellow is shown:

$ ng build @modules/mod1 --watch
Building Angular Package

------------------------------------------------------------------------------
Building entry point '@modules/mod1'
------------------------------------------------------------------------------
✖ Compiling with Angular sources in Ivy full compilation mode.
ERROR: Can't find stylesheet to import.
  ╷
1 │ @use 'includes/scrollbar';
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  projects\modules\mod1\src\lib\components\tree-diagram\tree-diagram.component.scss 1:1  root stylesheet

Compilation failed. Watching for file changes...