scully: Inconsistent behavior on npm run scully

🐞 Bug report

npm run scully script sometimes finishes correctly and sometimes gets stuck without doing nothing.

Description

I have a couple of projects that run scully before being deployed to their servers. The build process runs:

rm -fr ./dist
ng build --prod --optimization=true
npm run scully

where the scully script is: scully --prod --showGuessError --showBrowser=false --pluginsError=true --logSeverity=normal

πŸ’»Your Environment

Angular Version:



β†’ ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 11.2.5
Node: 14.15.5
OS: darwin x64

Angular: 11.0.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.3
@angular-devkit/build-angular   0.1100.3
@angular-devkit/core            9.1.13
@angular-devkit/schematics      9.1.13
@angular/cdk                    11.0.2
@angular/cli                    11.2.5
@schematics/angular             9.1.13
@schematics/update              0.803.29
rxjs                            6.6.3
typescript                      4.0.5


Scully Version:



    "@scullyio/init": "^1.0.1",
    "@scullyio/ng-lib": "^1.0.0",
    "@scullyio/scully": "^1.1.1",
    "@scullyio/scully-plugin-flash-prevention": "^1.1.1",

πŸ”₯ Exception or Error



Generating took 3.05 seconds for 7 pages:
  That is 2.29 pages per second,
  or 437 milliseconds for each page.
  
  Finding routes in the angular app took 0 milliseconds
  Pulling in route-data took 0 milliseconds
  Rendering the pages took 2.29 seconds

and the console is stuck there without doing nothing or showing any errors, or messages.

It sometimes works, it sometimes doesn’t. Need to at least have where to look at. And running the build process again is not an option, because we are using a 3rd party pipeline for this.

Hope you can help me with this. Regards.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 27 (11 by maintainers)

Most upvoted comments

@SanderElias seems to me that /killMe endpoint called here (https://github.com/scullyio/scully/blob/main/libs/scully/src/scully.ts#L166) is causing the issue, the process stays waiting for this process to be finished before leaving the execution to be finished.

The close server should have a way to force the shutdown (https://github.com/scullyio/scully/blob/main/libs/scully/src/lib/utils/serverstuff/staticServer.ts#L108) even if it has open connections.

I have found this discussion about how graceful shut down the server.

https://stackoverflow.com/a/43095094/6084944

Thanks for all the feedback. We are still working on this. Reproducing the issue turns out to be hard.

Angular CLI: 12.0.2
Node: 14.16.1
Package Manager: npm 6.14.13
OS: darwin x64

Angular: 12.0.2
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1200.2
@angular-devkit/build-angular   12.0.2
@angular-devkit/core            12.0.2
@angular-devkit/schematics      12.0.2
@angular/fire                   6.1.5
@schematics/angular             12.0.2
ng-packagr                      12.0.2
rxjs                            6.6.7
typescript                      4.2.4
    "@scullyio/ng-lib": "^1.1.1-BETA.73135",
    "@scullyio/scully": "^1.1.1-BETA.73135",
    "@scullyio/scully-plugin-flash-prevention": "^1.1.1-BETA.73135",

@Splaktar Using version 1.1.1, Scully works successfully when I build in in Github using Github Actions, but hangs when I run the same build actions locally using WSL.

If I ctrl^C the hanging Scully build at this point, it does appear that Scully has generated all the lazy route index.html files successfully …

@jsanta Oh, sorry, that was very unlcear from me. try it after npm i @scullyio/scully@develop I’m fairly sure that will cure your issue.