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

[dev-tool] compilation errors with TypeScript 5.7.2 #32278

Open
jeremymeng opened this issue Dec 17, 2024 · 0 comments
Open

[dev-tool] compilation errors with TypeScript 5.7.2 #32278

jeremymeng opened this issue Dec 17, 2024 · 0 comments
Labels
dev-tool Issues related to the Azure SDK for JS dev-tool

Comments

@jeremymeng
Copy link
Member

jeremymeng commented Dec 17, 2024

Likely due to the usage of ts-morph internals in our codemods

> tsc && npm run lint && npm run check-format

src/util/admin/migrate-package/codemods/replaceChaiAsPromised.ts:40:14 - error TS2352: Conversion of type 'Node' to type 'Expression' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Property '_expressionBrand' is missing in type 'Node' but required in type 'Expression'.

40             [args[0].compilerNode as ts.Expression],
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  ../../temp/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.d.ts:4831:9
    4831         _expressionBrand: any;
                 ~~~~~~~~~~~~~~~~
    '_expressionBrand' is declared here.

src/util/admin/migrate-package/codemods/replaceChaiAsPromised.ts:48:26 - error TS2345: Argument of type '() => ts.AwaitExpression' is not assignable to parameter of type '(traversal: TransformTraversalControl) => Node'.
  Call signature return types 'AwaitExpression' and 'Node' are incompatible.
    The types of 'kind' are incompatible between these types.
      Type 'SyntaxKind.AwaitExpression' is not assignable to type 'SyntaxKind'.

48           node.transform(() => {
                            ~~~~~~~

src/util/admin/migrate-package/codemods/replaceChaiAsPromised.ts:57:36 - error TS2352: Conversion of type 'Node' to type 'Expression' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Property '_expressionBrand' is missing in type 'Node' but required in type 'Expression'.

57                 args.length > 1 ? [args[1].compilerNode as ts.Expression] : [], // Pass second argument if provided
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  ../../temp/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.d.ts:4831:9
    4831         _expressionBrand: any;
                 ~~~~~~~~~~~~~~~~
    '_expressionBrand' is declared here.

src/util/admin/migrate-package/codemods/replaceSinonStubs.ts:80:39 - error TS2345: Argument of type 'LeftHandSideExpression' is not assignable to parameter of type 'Node'.
  Types of property 'kind' are incompatible.
    Type 'import("/home/meng/git/jssdk/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@ts-morph/common/lib/typescript").ts.SyntaxKind' is not assignable to type 'import("/home/meng/git/jssdk/common/temp/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript").SyntaxKind'.
      Each declaration of 'SyntaxKind.PartiallyEmittedExpression' differs in its value, where '355' was expected but '354' was given.

80         ts.isPropertyAccessExpression(callee.compilerNode) &&
                                         ~~~~~~~~~~~~~~~~~~~

src/util/admin/migrate-package/codemods/replaceSinonStubs.ts:81:47 - error TS2339: Property 'expression' does not exist on type 'never'.
  The intersection 'LeftHandSideExpression & PropertyAccessExpression' was reduced to 'never' because property 'kind' has conflicting types in some constituents.

81         isSinonIdentifier(callee.compilerNode.expression.getText()) &&
                                                 ~~~~~~~~~~

src/util/admin/migrate-package/codemods/replaceSinonStubs.ts:82:29 - error TS2339: Property 'name' does not exist on type 'never'.
  The intersection 'LeftHandSideExpression & PropertyAccessExpression' was reduced to 'never' because property 'kind' has conflicting types in some constituents.

82         callee.compilerNode.name.getText() === "restore"
                               ~~~~

src/util/admin/migrate-package/codemods/replaceSupportsTracing.ts:40:51 - error TS2345: Argument of type 'LeftHandSideExpression' is not assignable to parameter of type 'Node'.
  Types of property 'kind' are incompatible.
    Type 'import("/home/meng/git/jssdk/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@ts-morph/common/lib/typescript").ts.SyntaxKind' is not assignable to type 'import("/home/meng/git/jssdk/common/temp/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript").SyntaxKind'.
      Each declaration of 'SyntaxKind.PartiallyEmittedExpression' differs in its value, where '355' was expected but '354' was given.

40       if (callee && ts.isPropertyAccessExpression(callee.compilerNode)) {
                                                     ~~~~~~~~~~~~~~~~~~~

src/util/admin/migrate-package/codemods/replaceSupportsTracing.ts:42:47 - error TS2339: Property 'expression' does not exist on type 'never'.
  The intersection 'LeftHandSideExpression & PropertyAccessExpression' was reduced to 'never' because property 'kind' has conflicting types in some constituents.

42           ts.isIdentifier(callee.compilerNode.expression) &&
                                                 ~~~~~~~~~~

src/util/admin/migrate-package/codemods/replaceSupportsTracing.ts:43:31 - error TS2339: Property 'expression' does not exist on type 'never'.
  The intersection 'LeftHandSideExpression & PropertyAccessExpression' was reduced to 'never' because property 'kind' has conflicting types in some constituents.

43           callee.compilerNode.expression.text === "expect" &&
                                 ~~~~~~~~~~

src/util/admin/migrate-package/codemods/replaceSupportsTracing.ts:44:31 - error TS2339: Property 'name' does not exist on type 'never'.
  The intersection 'LeftHandSideExpression & PropertyAccessExpression' was reduced to 'never' because property 'kind' has conflicting types in some constituents.

44           callee.compilerNode.name.text === "extend"
                                 ~~~~

src/util/admin/migrate-package/codemods/replaceSupportsTracing.ts:92:26 - error TS2345: Argument of type '() => ts.AwaitExpression' is not assignable to parameter of type '(traversal: TransformTraversalControl) => Node'.
  Call signature return types 'AwaitExpression' and 'Node' are incompatible.
    The types of 'kind' are incompatible between these types.
      Type 'SyntaxKind.AwaitExpression' is not assignable to type 'SyntaxKind'.

92           node.transform(() => {
                            ~~~~~~~

src/util/admin/migrate-package/codemods/replaceSupportsTracing.ts:99:22 - error TS2352: Conversion of type 'Node' to type 'Expression' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Property '_expressionBrand' is missing in type 'Node' but required in type 'Expression'.

99                     [asyncFunction.compilerNode as ts.Expression],
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  ../../temp/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.d.ts:4831:9
    4831         _expressionBrand: any;
                 ~~~~~~~~~~~~~~~~
    '_expressionBrand' is declared here.

src/util/admin/migrate-package/codemods/replaceSupportsTracing.ts:104:18 - error TS2352: Conversion of type 'Node' to type 'Expression' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Property '_expressionBrand' is missing in type 'Node' but required in type 'Expression'.

104                 [methodArray.compilerNode as ts.Expression],
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  ../../temp/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.d.ts:4831:9
    4831         _expressionBrand: any;
                 ~~~~~~~~~~~~~~~~
    '_expressionBrand' is declared here.


Found 13 errors in 3 files.
@jeremymeng jeremymeng added the dev-tool Issues related to the Azure SDK for JS dev-tool label Dec 17, 2024
jeremymeng added a commit that referenced this issue Dec 18, 2024
with `rush add --dev -m -p typescript@~5.7.2`

except `dev-tool` due to copmilation error detailed at #32278.

Also bump versions in non-rush projects and samples.

***NO_CI***
jeremymeng added a commit that referenced this issue Dec 18, 2024
with `rush add --dev -m -p typescript@~5.7.2`

except `dev-tool` due to copmilation error detailed at #32278.

Also bump versions in non-rush projects and samples.

***NO_CI***
jeremymeng added a commit that referenced this issue Dec 18, 2024
with `rush add --dev -m -p typescript@~5.7.2`

except `dev-tool` due to copmilation error detailed at #32278.

Also bump versions in non-rush projects and samples.

***NO_CI***

cosmos: fix new error about implicit `any[]`

storage-blob: react to `Buffer` typing change

storage-file-datalake test: react to Uint8Array typing change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-tool Issues related to the Azure SDK for JS dev-tool
Projects
None yet
Development

No branches or pull requests

1 participant