diff --git a/src/commands/InitCommand.ts b/src/commands/InitCommand.ts index 1a62a2a622..8a14d2738f 100644 --- a/src/commands/InitCommand.ts +++ b/src/commands/InitCommand.ts @@ -377,7 +377,9 @@ export const Routes = [{ * Gets contents of the user controller file (used when express is enabled). */ protected static getControllerTemplate(isEsm: boolean): string { - return `import { AppDataSource } from '../data-source' + return `import { AppDataSource } from "../data-source${ + isEsm ? ".js" : "" + }" import { NextFunction, Request, Response } from "express" import { User } from "../entity/User${isEsm ? ".js" : ""}"