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:
- Created 2 years ago
- Reactions:5
- Comments:8 (2 by maintainers)
Top GitHub Comments
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 deletenode_modules/.cache
.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: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 yourpackage.json
script with the following: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”