question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scully is using stored routes despite running with --scanRoutes

See original GitHub issue

🐞 Bug report

Update:

I found the bug (more precisely it’s misleading message). In the warning message it suggests to run: npm run scully -- --scanRoutes but when I ran it, it didn’t work, I think because it runs npx scully -- --scanRoutes instead of npx scully --scanRoutes. I ended up adding custom script to package.json: "scully:routes": "npx scully --scanRoutes",

Hello,

I’ve added a new route and ran scully with the command npm run scully -- --scanRoutes. When running this command, the output contains the following warning and scully doesn’t fetch new routes:

Using stored unhandled routes!.
To discover new routes in the angular app use "npm run scully -- --scanRoutes"

Why is that? I run the command with the --scanRoutes option, I expect it to scan new routes. I should mention, that I did build angular application before running scully command.

Angular Version:



Angular CLI: 11.2.8
Node: 12.10.0
OS: darwin x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.8
@angular-devkit/build-angular   0.1102.8
@angular-devkit/core            11.2.8
@angular-devkit/schematics      11.2.8
@angular/cli                    11.2.8
@schematics/angular             11.2.8
@schematics/update              0.1102.8
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",

Whole scully output:

> personal-website@0.0.0 scully
> npx scully -- "--scanRoutes"

logging with severity "warning"
using plugins from folder "./scully"
 ☺   new Angular build imported
Starting background servers with: node ./node_modules/@scullyio/scully/src/scully.js serve --tds false --pjf false --ls warning --noCache true --project personal-website
 ☺   Started servers in background
Finding all routes in application.

----------------------------------
Using stored unhandled routes!.
   To discover new routes in the angular app use "npm run scully -- --scanRoutes"
----------------------------------
Pull in data to create additional routes.
Route list created in files:
  "./src/assets/scully-routes.json",
  "/personal-website/dist/static/assets/scully-routes.json",
  "/personal-website/dist/personal-website/assets/scully-routes.json"

Route "/" rendered into file: "./dist/static/index.html"

Generating took 1.51 seconds for 1 pages:
  That is 0.67 pages per second,
  or 1514 milliseconds for each page.

  Finding routes in the angular app took 1 milliseconds
  Pulling in route-data took 0 milliseconds
  Rendering the pages took 719 milliseconds

Routes file:

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { TestComponent } from './test/test.component';

const routes: Routes = [
  {path: 'test', component: TestComponent}
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kogiokkacommented, Aug 1, 2021

It will be nice to resolve this problem. Newbie here, just spent an hour figuring out why I kept getting No configuration for route "/id/:id" found. Skipping even I had changed the path in both the scully config and the angular app.

npx scully --scanRoutes works in my case. Another solution is to delete node_modules/.cache.

1reaction
SanderEliascommented, Mar 25, 2022

This is an issue with how NPM scripts are working and is not something Scully can solve. If you use npm run scully you need to add -- to tell NPM that you want to give parameters to the command. so run it like this:

npm run scully -- --scanRoutes

When using NPX, you don’t need to add -- and doing so might break things To make the whole story more cumbersome, in different versions of NPM different things happened. For a while adding the -- into the NPM script helped, and the user didn’t need to provide them. But it turns out that this works differently, depending on OS and NPM version. As a result we had the -- in some versions of our schematics, and those ended up in the package.json scripts. If you have them there, remove them. An easy way to workaround this is updating your package.json script with the following:

  "scripts": {
    "/** ","Other scripts are still here! **/",
    "scully": "npx scully",
    "scully.scan": "npx scully --scanRoutes",
    "scully.serve": "npx scully serve"
  },

Then, when you want to scan, you can run npm run scully.scan I’m closing this issue, as its not something we can “fix”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions - Scully.io
Scully documentation page containing Frequently Asked Questions,Ignoring Routes,Plugins ... Scully is using stored routes despite running with --scanRoutes?
Read more >
scullyio/community - Gitter
It's a dynamic route using the ':post-slug' param and resolved in the ... To discover new routes in the angular app use "npm...
Read more >
Crafting an Angular Static Website with Scully [Live Demo]
It's important to pass the flag --scanRoutes so it will discover all routes to generate. npm run scully:serve -- --scanRoutes. Open the URL...
Read more >
Using Angular's router in your Markdown file hyperlinks with ...
The link reference matches one of the ScullyRoutes that it finds when it scans your app ( npm run scully -- --scanRoutes is...
Read more >
Build Jamstack site with Angular and Scully - Kontent.ai
Scully is the first and only static site generator for Angular, although it works completely differently ... npm run scully -- -- scanRoutes....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found