Skip to content

Commit 5af323d

Browse files
vikermanalan-agius4
authored andcommitted
fix(builder): update prerender error message
1 parent 11a063e commit 5af323d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

modules/builders/src/prerender/index.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ describe('Prerender Builder', () => {
148148

149149
it('should throw if no routes are given', async () => {
150150
options.routes = [];
151-
const expectedError = new Error('No routes found. options.routes must contain at least one route to render.');
151+
const expectedError = new Error(
152+
'No routes found. Specify routes to render using `prerender.options.routes` in angular.json.');
152153
await expectAsync(
153154
PrerenderModule._prerender(options, context)
154155
).toBeRejectedWith(expectedError);

modules/builders/src/prerender/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export async function _prerender(
129129
context: BuilderContext
130130
): Promise<BuilderOutput> {
131131
if (!options.routes || options.routes.length === 0) {
132-
throw new Error('No routes found. options.routes must contain at least one route to render.');
132+
throw new Error('No routes found. Specify routes to render using `prerender.options.routes` in angular.json.');
133133
}
134134
const browserTarget = targetFromTargetString(options.browserTarget);
135135
const serverTarget = targetFromTargetString(options.serverTarget);

0 commit comments

Comments
 (0)