我正在尝试将 ts 版本从 3.9.x 更新到最新版本,如果更新到 4.7.4 或更早版本没有问题,但 4.8.x 版本在编译时抛出错误。\n错误:Unhandled SyntaxKind: ImportClause
除此之外,这是错误信息,我无法跟踪引发问题的文件名,有什么方法可以更好地调试它。我尝试登录节点模块包本身发现源文件对象不确定这是否是错误的根源。
\nsrc/index.ts \xe2\x86\x92 dist/index.js...\nDeprecationWarning: 'createLiteral' has been deprecated since v4.0.0. Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead.\nDeprecationWarning: 'updateImportDeclaration' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.\nDeprecationWarning: 'createLiteralTypeNode' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation …Run Code Online (Sandbox Code Playgroud) javascript typescript typescript-generics typescript-typings
如果我在模块中将服务声明为提供者,但没有在服务中使用 @Injectable 装饰器,会发生什么情况?
//Module
module({
controller: [catController],
provider: [catService]
})
//Service
//@Injectable()
export class catService{
}
Run Code Online (Sandbox Code Playgroud)
我认为令牌将被注册但不会被使用,并且每次都会共享新实例。我对么?