Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ofirrifo opened this issue Jun 15, 2020 · 2 comments
Open

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

ofirrifo opened this issue Jun 15, 2020 · 2 comments

Comments

@ofirrifo
Copy link

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

@polonmedia
Copy link

same here

@flobiber
Copy link

With cast to any it will build but it doesn't work as excepted. Always added imports, also if there are already there (Seems like the SourceFile analysis isn't working correct).

For me, i just copied the relevant parts into my project - now everything is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants