Skip to content

type script exception after upgrade to "typescript": "~3.8.2" #28

Open
@ofirrifo

Description

@ofirrifo

After I upgrade from "typescript": "~3.5.3" to "typescript": "~3.8.2" I start to get
the following error:

src/schematics-utils/schematics.utils.ts:39:33 - error TS2345: Argument of type 'import("/../node_modules/typescript/lib/typescript").SourceFile' is not assignable to parameter of type 'import("/../node_modules/schematics-utilities/node_modules/@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript").SourceFile'.
  Types of property 'kind' are incompatible.
    Type 'import("/../node_modules/typescript/lib/typescript").SyntaxKind.SourceFile' is not assignable to type 'import("/../node_modules/schematics-utilities/node_modules/@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript").SyntaxKind.SourceFile'.

39     const change = insertImport(sourceFile, pathFileToEdit, importSymbolName, importPath, isDefault) as InsertChange;
                                   ~~~~~~~~~~

I have a utils imports in my code

import * as ts from 'typescript';
import { InsertChange, insertImport } from 'schematics-utilities';
}

in case I'm replace the type ts.SourceFile to any the build work but I want to keep the type
I think it happen since the

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions