Need to run "ng build | serve | test" twice to finish command without errors #19395
Closed
3 of 15 tasks
Labels
area: @ngtools/webpack
freq1: low
Only reported by a handful of users who observe it rarely
severity3: broken
type: bug/fix
Milestone
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, if I remember correctly with Angular 8 this error was not present or at least I didn't stumble across it. (I'm not entirely sure but it is also possible that it worked as well with Angular 9)
Description
I'm the author of the angular library
angular-archwizard
which I build with angular-cliand
ng-packagr. In addition to the main repository that contains the sourcecode for the library I have a second repository called
angular-archwizard-demothat contains an angular project with a number of buildable examples using
angular-archwizard`.I also use the
angular-archwizard-demo
project for manual testing to ensure that any changes that I make on the sourcecode of the library continues to function correctly visually. For this purpose I'm added a custom "preinstall" script to my travis setup that first clones theangular-archwizard
repository, builds it locally and then includes it into theangular-archwizard-demo
project usingnpm install --save ../angular-archwizard/dist
.For a while now I discovered that I need to run certain
ng
commands twice to get a "successful" result. These commands areng build
,ng serve
andng test
. The first time I executeng build
orng serve
I receive an erroneous build, that leads to the following error message in the console of Chromium:The second time I get a functional build, that works as expected.
When running
ng test
for the first time it fails with the errors as shown in the following Travis CI job. When executing the tests for the second time they finish successfully.In my opinion it is also important to note that I build the library itself (
angular-archwizard
) with Ivy disabled and the demo project (angular-archwizard-demo
) with Ivy enabled. If I change this to either building both projects with Ivy enabled or disabled the commands work as expected on the first try. Therefore my guess is that the interoperability of Ivy projects with non-Ivy projects is somehow erroneous (or my config is)🔬 Minimal Reproduction
Tasks to build the library
angular-archwizard
(https://github.com/madoar/angular-archwizard)npm install
)npm run build
)Tasks to build the demo and run its tests
angular-archwizard-demo
(https://github.com/madoar/angular-archwizard-demo)git checkout enhancement-update-dependencies
)package-lock.json
fileangular-archwizard
(npm install --save ../angular-archwizard/dist
)npm install
)npm test
)🔥 Exception or Error
npm test
)npm test
)🌍 Your Environment
Anything else relevant?
Off-topic: If you execute the above commands with node 15 you get an error message because of an incompatible karma version (
5.2.x
is larger than5.1.x
)The text was updated successfully, but these errors were encountered: