ver 我试下来应该是 es 版本的问题,我使用 es5 和 es6 懒加载就没问题,使用 esnext 就有问题,你把 ts.config.json 修改如下
{
"compilerOptions": {
"lib": ["esnext", "es6"],
"target": "es6",
"module": "CommonJS",
"moduleResolution": "Node",
"outDir": "./build",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
// "strict": true,
"esModuleInterop": true,
"alwaysStrict": true,
"pretty": true,
"allowJs": true,
}
}
这个问题挺奇怪的,如果有兴趣可以去 typeorm 的官方提 issue 问一下