scullyio / scully

The Static Site Generator for Angular apps

Home Page:https://scully.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scully project error when upgrading from Angular v13 to Angular v14

nelsongutidev opened this issue Β· comments

🐞 Bug report

Scully would not build after upgrading my project to from angular v13 to angular 14

Description

The following error was thrown:

  Config file "./scully.undefined.config.ts" not found, only rendering routes without parameters
  The config file should have a name that is formated as:
      scully.<projectName>.config.ts
  where <projectName> is the name of the project as defined in the 'angular.json' file
  If you meant to build a different project as undefined you can use:
      --project differentProjectName as a cmd line option

  When you are in a mixed mono-repo you might need to use the --pjFirst flag.
   which will look for package.json instead of angular.json to find the 'root' of the project.
=====================================================================================================

Could not find project "undefined" in 'angular.json'.

πŸ”¬ Minimal Reproduction

Upgrade project to angular 14. Run ng build and then run npx scully

πŸ’»Your Environment

Mac OS

Angular Version:




Angular CLI: 14.2.4
Node: 16.17.0
Package Manager: npm 8.15.0 
OS: darwin arm64

Angular: 14.2.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... 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                            6.6.7
typescript                      4.6.4

Scully Version:


2.1.0


πŸ”₯ Exception or Error


After running npx scully, the following was thrown on cli

  Could not find project "undefined" in 'angular.json'.

βœ… Root cause of the issue and workaround:

With angular v14, the defaultProject property on the angular.json file has been removed/deprecated. While this gets fixed on Scully side, one can just add it back and Scully will build fine.

On angular.json file, add:

"defaultProject": "your-project-name"

Thanks @nelsongutidev , adding "defaultProject": "client" to angular.json fixed installing scully for angular 14 for me.