Scully: Inconsistent behavior on npm run scully

Created on 3 May 2021  ·  16Comments  ·  Source: scullyio/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.

bug

All 16 comments

We dus observe this before, and did put in a fix.
Can you try the develop version?
If that works, I'll release a patch version

Thanks @SanderElias . How can I try with the develop version?

I was trying by wrapping the scully command in
bash -c '(sleep 300; kill $$) & exec _SCULLY_CMD_HERE_'

but as I'm using a monorepo I'm loosing the project parameter. Anyway this workaround doesn't solve the problem, it just kills the process if it's running after 300 seconds...

Hello again.

OK, here's what I did:

  1. Cloned the repo
  2. npm run build-all
  3. cd dist/libs
  4. npm pack for scully, ng-lib and flash-prevention-plugin
  5. Back to my project folder
  6. npm install for each packed lib

So far so good, but I don't really know if I'm really working with a patched or corrected version (all tgz files read 1.1.1 as the version).

@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.

Thanks @SanderElias and sorry for not explaining myself very well.
The develop version seems to work without problems. Will need to make several more runs to validate but no problems detected yet.
Thanks :)

I solved this by making sure to have a on the components that were being used to host as routes.

I'm using components to create SEO slugs and it'd freeze like this, but not after adding

Not our use case @beatsbybre , as the monorepo we are working on has many non-routing components.
As I said, the development version worked fine. Already made more than a few build runs without problems 👍🏻

I can verify I have encountered this same problem as @jsanta and the suggestion of @SanderElias to use the develop version solved the issue.

It looks like that @develop version was released as 1.1.1 which I thought at first solved this for me. Unfortunately, I've continued to see this problem where it finishes and just hangs.

Using

    "@scullyio/init": "^1.1.4",
    "@scullyio/ng-lib": "^1.1.1",
    "@scullyio/scully": "^1.1.1",

@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 ...

I've switched from

    "scully": "rm -rf dist/apps/xlts-dev-static && scully --configFile scully.xlts.dev.config.ts",
    "scully:scan": "rm -rf dist/apps/xlts-dev-static && scully --configFile scully.xlts.dev.config.ts --scanRoutes",

to

    "scully": "scully --configFile scully.xlts.dev.config.ts --removeStaticDist",
    "scully:scan": "scully --configFile scully.xlts.dev.config.ts --scanRoutes  --removeStaticDist",

and thought that might have helped, but then after some more testing, I saw Scully hang a few more times.

Yeah, I kill it and then I'm generally able to deploy w/o any issues, but it breaks my CI a lot (CircleCI) which is a real pain. You generally don't want anything flaky in your CI process like this.

I have closed an issue around this a while ago, and it should be solved by now, but we still occasionally see this behavior.
It would be so much easier if we would have a solid way to reproduce this issue.

I would like to discuss some o my findings here.
In a couple of runs, it seems that the combo node 12 with Angular 11 is the most prone to this. I seem to have the least issues with node 14.
Can you all please state your node and angular version, too see if we can find a common thing?

Angular CLI: 12.0.2
Node: 14.17.0
Package Manager: npm 6.14.13
OS: linux x64

Angular: 12.0.2
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, 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 9.1.15
@angular-devkit/schematics 9.1.15
@schematics/angular 9.1.15
rxjs 6.6.7
typescript 4.2.4


I tried about 10 local builds in a row and Scully only hung once.

@SanderElias If you think it might help, I can give you access to my private repo.

@jamieathans no, it is a generic problem. I'm glad that it happens for you on local builds too. That would allow me to do some scripting to see if I can reproduce it locally, as that would give me something to go on! BTW, right after my previous post, it stalled in our GA also on V14, so it isn't node or Angular version specific.

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",
Was this page helpful?
0 / 5 - 0 ratings

Related issues

nishimura-yuji picture nishimura-yuji  ·  4Comments

pierresigwalt picture pierresigwalt  ·  4Comments

dbubenheim picture dbubenheim  ·  4Comments

puku0x picture puku0x  ·  4Comments

ghost picture ghost  ·  4Comments