0

When I created my Angular app and tried to add Scully for SEO static it just silently failed without creating:

  • scully.my-blog{{your blog name here}}.config.ts
  • scully folder in the root of the app with tsconfig.json and plugins folder with plugin.ts file

I used the command as in the Scully documentation: https://scully.io/docs/learn/overview/

ng add @scullyio/init

Tatyana Molchanova
  • 1,305
  • 5
  • 12
  • 23

2 Answers2

11

Previous answer is not solving the issue.

PS D:\ANGULAR-PROJECTS\my-blog> ng generate @scullyio/init:markdown ? What name do you want to use for the module? posts ? What slug do you want for the markdown file? id ? Where do you want to store your markdown files? mdfiles ? Under which route do you want your files to be requested? posts No scully configuration file found scully.undefined.config.ts Path "/scully.undefined.config.ts" does not exist.

      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.

blog@0.0.0 scully 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.
=====================================================================================================

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

The right solutions is here!!!

  1. in angular.json add in the root of the object:

"defaultProject": "my-blog",

{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "defaultProject": "my-blog", "projects": { "my-blog": { "projectType": "application", "schematics": { "@schematics/angular:component": { "style": "scss" } },

  1. And name the scully file as scully.my-blog.config.ts

scully undefined solved

Tatyana Molchanova
  • 1,305
  • 5
  • 12
  • 23
  • 1
    I am running Angular 14 and even though "defaultProject": "my-blog" is deprecated, ng generate @scullyio/init:markdown worked after adding this. – tclarkston Nov 04 '22 at 15:47
  • 2
    Thank you so much for this! Saved me a lot of time! Always such a beautiful thing to have each of us strengthen the community with our individual contributions. :) – Ragav Y Nov 19 '22 at 13:43
  • Didn't work for me. After I added that I got. Cannot read properties of null (reading 'toString'). – Norbert Norbertson Jul 19 '23 at 13:05
2

The problem was here that there was not defined the name of the project as the option of this CLI command.

The right solutions is here:

ng add @scullyio/init --project=my-blog

where my-blog is the name of my project

And yes, there was yet several npm issues - I have an Angular app of 14 version but angular/animations needs to be "@angular/animations": "^12.2.16" - you need to change the version in your package.json, and it doesn't work until I run

npm install --legacy-peer-deps.

Tatyana Molchanova
  • 1,305
  • 5
  • 12
  • 23
  • I have Angular 14, too. But that did not work for me. What exactly did you put into the package.json and what commands did you execute ? – Janumar May 20 '23 at 15:25
  • Here we are again, battling the most crummy set of dev tools and environment I've ever worked with. Just when you think you're motoring with Angular and JS you end up here. Wasting a whole day on this mess and finally giving up and deciding that Blazor is the answer. – Norbert Norbertson Jul 19 '23 at 11:51