Closed lukasmatta closed 2 years ago
try using --forceScan
instead?
I'm afraid that there are some problems about npm or npx arguments.
I can make all routes files by adding script on package.json like this.
"scripts: { "jam": "ng build && npx scully --scanRoutes && npm run scully serve" } I just skip arguments,"--",I don't know why does it work.
I was stacked on this issue too. Sorry for my poorness of English. :(
Yes you're right. I've already updated my post, after I found that the problem is in argument handling:
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"
@lukasmatta This is more of an npm
issue.
the --
is telling npm to add whatever is after that, to the command that is being started.
However, if that command ends with --
it's not entirely sure what happens.
Hi, first of all, congrats on the work and I am loving Scully so far.
I followed the doc today and ended with this problem too.
When I run npx scully
it recommends the usage of npm run scully -- --scanRoutes
, which runs the package.json script adding the parameter.
But the package.json script added by the schematics already has dashes "scully": "npx scully --"
so the result is this npx scully -- --scanRoutes
.
Either changing the schematics or the command recommendation would fix this.
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
.
Ditto same issue is occuring with me. Any idea on how to fix this?
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"
🐞 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 runsnpx scully -- --scanRoutes
instead ofnpx 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: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:
Scully Version:
Whole scully output:
Routes file: