scullyio / scully

The Static Site Generator for Angular apps
https://scully.io/
MIT License
2.56k stars 257 forks source link

Scully doesn't generate anything #1606

Open RinatValiullov opened 2 years ago

RinatValiullov commented 2 years ago

🐞 Bug report

Trying to install the blog I am not getting any changes to the project. The package does nothing at all. But the dependency @scullyio/init is installed. Dependency @scullyio/ng-lib NOT installed.

Description

🔬 Minimal Reproduction

  1. Run this command in terminal ng add @scullyio/init
  2. After choosing:
    ? Which route renderer would you like to use? 
    > Scully platform server

    nothing happens (I don't get any answer at all):

image

Scully doesn't create config file and doesn't import ScullyLibModule in the main application module.

💻Your Environment

Angular Version:




Angular CLI: 14.0.7
Node: 16.16.0
Package Manager: npm 8.14.0 
OS: win32 x64

Angular: 14.1.0
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router     

Package                         Version
---------------------------------------------------------  
@angular-devkit/architect       0.1401.0
@angular-devkit/build-angular   14.1.0
@angular-devkit/core            14.1.0
@angular-devkit/schematics      14.0.7
@angular/cli                    14.0.7
@schematics/angular             14.0.7
rxjs                            7.5.6
typescript                      4.7.4

Scully Version:




"@scullyio/init": "^2.1.36"

🔥 Exception or Error




Lindurion commented 2 years ago

Hitting the same issue (even from a brand new Angular 14 app workspace). Debugging a little bit, exception being thown is: TypeError: Cannot read properties of null (reading 'toString')

at https://github.com/scullyio/scully/blob/v2.1.39/libs/scully-schematics/src/utils/utils.ts#L151 (line 149 also throws the same error trying to invoke null.toString())

Seems like the issue is project being 'defaultProject', for which the host.read() calls return null.

Initializing with an explicit --project command-line argument seems to get past this problem:

npx ng add @scullyio/init --project=my-project-name

but if you choose what seems like the default renderer option (Scully platform server), the init schematic fails on a later step with:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-project-name@0.2.0
npm ERR! Found: @angular/animations@14.1.1
npm ERR! node_modules/@angular/animations
npm ERR!   @angular/animations@"^14.1.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/animations@"12.2.16" from @angular/platform-server@12.2.16
npm ERR! node_modules/@angular/platform-server
npm ERR!   @angular/platform-server@"^12" from the root project

(I did not try going in and updating Scully's @angular/platform-server version to 14).

But trying to init again and choosing Pupeteer completed the init schematic successfully.

Side note, I then had to remove the extra -- from the package.json Scully commands:

npx scully --project my-project-name

This default generated script did NOT work work (running from Windows Terminal PowerShell 7, though I would hope that doesn't affect behavior):

npx scully -- --project my-project-name
RinatValiullov commented 2 years ago

@Lindurion

Is this specific for Windows users only?

Lindurion commented 2 years ago

Is this specific for Windows users only?

Nope. Just tried on macOS with a fresh Angular 14 app and hit exactly the same results above, including the need to remove the extra -- separator before the --project argument.

RinatValiullov commented 2 years ago

@Lindurion

Tried repeat with deprecated "defaultProject" and chose Scully platform server. Get this upstream dependency conflict:

image

I think this is a bug with not updated versions of dependencies on the Scully side.

stevermeister commented 2 years ago

same here :(

Angular CLI: 14.1.0
Node: 18.3.0 (Unsupported)
Package Manager: npm 8.11.0
OS: darwin arm64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1401.0 (cli-only)
@angular-devkit/core         14.1.0 (cli-only)
@angular-devkit/schematics   14.1.0 (cli-only)
@schematics/angular          14.1.0 (cli-only)
SanderElias commented 2 years ago

The upstream dependency is caused by some strange handling of peer-deps. I have been looking into this but have not yet found a solution. That being said, you can install Scully using --force on the npm install command.

morenoisidro commented 2 years ago

Same problem here.

Angular CLI: 14.2.4
Node: 16.14.2
Package Manager: npm 8.5.0
OS: win32 x64

Angular: 14.2.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.4
@angular-devkit/build-angular   14.2.4
@angular-devkit/core            14.2.4
@angular-devkit/schematics      14.2.4
@schematics/angular             14.2.4
rxjs                            7.5.7
typescript                      4.7.4
morenoisidro commented 2 years ago

Same problem here.

Angular CLI: 14.2.4
Node: 16.14.2
Package Manager: npm 8.5.0
OS: win32 x64

Angular: 14.2.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.4
@angular-devkit/build-angular   14.2.4
@angular-devkit/core            14.2.4
@angular-devkit/schematics      14.2.4
@schematics/angular             14.2.4
rxjs                            7.5.7
typescript                      4.7.4

As @Lindurion and @SanderElias suggested, this worked for me:

npx --force ng add --force @scullyio/init --project=[PROJECT_NAME]

Where PROJECT_NAME is the one specified under angular.json

Output:

> npx --force ng add --force @scullyio/init --project=ng-kitsune-site
npm WARN using --force Recommended protections disabled.
Skipping installation: Package already installed
? Which route renderer would you like to use? Scully platform server
    polyfills.ts is already upto date
    Installing ng-lib
    Installing Scully Platform Server plugin
UPDATE .gitignore (680 bytes)
UPDATE package.json (1228 bytes)
✔ Packages installed successfully.
CREATE scully.ng-kitsune-site.config.ts (325 bytes)
UPDATE package.json (1354 bytes)
CREATE scully/tsconfig.json (450 bytes)
CREATE scully/plugins/plugin.ts (305 bytes)
koreem commented 1 year ago

Same issue