-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* improvement(treaverseapproutes): more explainatory error update the error to list common casues, and exit the proccess * improvement(contentrenderplugin.ts): better error on missin httpClienmodule or scully-content * feat(contentrenderplugin): update other error display too * fix(traverserouteplugin): fix wrong import
- Loading branch information
1 parent
fac6eef
commit cc63194
Showing
2 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
import {parseAngularRoutes} from 'guess-parser'; | ||
import {scullyConfig} from '../utils/config'; | ||
import {logError} from '../utils/log'; | ||
|
||
export const traverseAppRoutes = async (appRootFolder = scullyConfig.projectRoot) => { | ||
try { | ||
const routes = parseAngularRoutes(appRootFolder).map(r => r.path); | ||
|
||
return routes; | ||
} catch (e) { | ||
console.log('e', e); | ||
// console.log('e', e); | ||
throw new Error('Scully could not traverse routes'); | ||
logError(` | ||
We encountered a problem while reading the routes from your applications source. | ||
This might happen when there are lazy-loaded routes, that are not loaded, | ||
Or when there are paths we can not resolve statically. | ||
Check the routes in your app, rebuild and retry. | ||
`); | ||
process.exit(15); | ||
} | ||
}; |