Scully: Adding blog support not working in scully init version 1.1.3

Created on 6 Apr 2021  ·  4Comments  ·  Source: scullyio/scully

🐞 Bug report

When adding blog support in scully init version 1.1.3 no blog module is created and the project build fails. When I manually revert scully init to an earlier version , e.g. 1.0.1 the module is created and everything works as described in the documentation.
Not really sure if that's a bug or I screwed it up, just wanted to let you know what I figured out.

Description

Today I tried to setup a blog by executing

ng generate @scullyio/init:blog

but this does not provide a blog module for serving the static md files.

ng generate @scullyio/init:blog

    ✅️ Update scully.my-blog.config.ts
UPDATE scully.my-blog.config.ts (294 bytes)
UPDATE src/app/app-routing.module.ts (335 bytes)
    ✅️ Blog ./blog/2021-04-06-blog.md file created
CREATE blog/2021-04-06-blog.md

When you try to run a build afterwards by ng build --prod it fails.

Error: ./src/app/app-routing.module.ts
Module not found: Error: Can't resolve './blog/blog.module'

🔬 Minimal Reproduction

ng new some-project

cd some-project

ng build --prod

ng add @scullyio/init

# ng add @scullyio/[email protected] works

ng generate @scullyio/init:blog

ng build --prod

💻Your Environment

Angular Version:


    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 11.2.7
Node: 15.13.0
OS: darwin x64

Angular: 11.2.8
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.7
@angular-devkit/build-angular   0.1102.7
@angular-devkit/core            11.2.7
@angular-devkit/schematics      11.2.7
@angular/cli                    11.2.7
@schematics/angular             11.2.7
@schematics/update              0.1102.7
rxjs                            6.6.7
typescript                      4.1.5

Scully Version:


"@scullyio/init": "^1.1.3",
"@scullyio/ng-lib": "^1.0.0",
"@scullyio/scully": "^1.0.0",

🔥 Exception or Error


Error: ./src/app/app-routing.module.ts
Module not found: Error: Can't resolve './blog/blog.module'
question

Most helpful comment

Thanks for the clarification and quick response.

All 4 comments

@Jefiozie I think we missed more as only the JSON file. Would you be able to take a look?

@dbubenheim thank you for reporting this issue, I tried to reproduce the issue based on your steps. The outcome is a bit different as you can look below:

image

That set, the Scully schematics (and Scully projects overall) require at least a route and the RouterModule included in an Angular project. This is the minimal setup that is needed, for reference you can look at this link. So I don't think there is an issue/ bug based on the problems you have and what we can see at this moment.

Let us know if there is anything else

I'm going to close this as there is no actionable content left.
@dbubenheim We are going to add an error message that will highlight why the schematic isn't "working"

Thanks for the clarification and quick response.

Was this page helpful?
0 / 5 - 0 ratings