Skip to content

Commit

Permalink
style: mention source maps if they are missing
Browse files Browse the repository at this point in the history
When sourceMap is set to false, the router generator fails to find the
TypeScript class declaration for the router and fails. This requirement
is mentioned in the documentation, but debugging is faster if it is
also mentioned at the time the source maps are actually needed.
  • Loading branch information
dmurvihill committed Jan 28, 2025
1 parent 8e921eb commit b6e5f5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/nestjs-trpc/lib/generators/router.generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export class RouterGenerator {
const classDeclaration = sourceFile.getClass(routerName);

if (!classDeclaration) {
throw new Error(`Could not find router ${routerName} class declaration.`);
throw new Error(
`Could not find router ${routerName} class declaration. Did you set compilerOptions.sourceMap to true in tsconfig.json?`,
);
}

const methodDeclaration = classDeclaration.getMethod(procedure.name);
Expand Down

0 comments on commit b6e5f5b

Please sign in to comment.