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

Incompatible with TypeScript 4.8 #132

Open
ViSaturn opened this issue Aug 28, 2022 · 2 comments
Open

Incompatible with TypeScript 4.8 #132

ViSaturn opened this issue Aug 28, 2022 · 2 comments

Comments

@ViSaturn
Copy link

The result of attempting running ttsc with typescript-is on TypeScript 4.8.2:

DeprecationWarning: 'createIdentifier' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createParameterDeclaration' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createEmptyStatement' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createTypeOfExpression' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createStringLiteral' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createStrictInequality' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createNull' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createStrictEquality' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: '' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createCallExpression' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createBinaryExpression' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createPropertyAssignment' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createObjectLiteralExpression' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createReturnStatement' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createIfStatement' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createBlock' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createFunctionDeclaration' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.

/home/pac/project/node_modules/typescript/lib/typescript.js:119152
                throw e;
                ^
NestedError: Failed to transform node at: /home/pac/project/spec/index.ts:285:18
    at transformNodeAndChildren (/home/pac/project/node_modules/typescript-is/lib/transform-inline/transformer.js:60:15)
    at /home/pac/project/node_modules/typescript-is/lib/transform-inline/transformer.js:62:62
    at visitArrayWorker (/home/pac/project/node_modules/typescript/lib/typescript.js:90614:48)
    at visitNodes (/home/pac/project/node_modules/typescript/lib/typescript.js:90577:23)
    at Object.visitEachChild (/home/pac/project/node_modules/typescript/lib/typescript.js:90934:173)
    at transformNodeAndChildren (/home/pac/project/node_modules/typescript-is/lib/transform-inline/transformer.js:62:15)
    at /home/pac/project/node_modules/typescript-is/lib/transform-inline/transformer.js:62:62
    at visitNode (/home/pac/project/node_modules/typescript/lib/typescript.js:90525:23)
    at Object.visitEachChild (/home/pac/project/node_modules/typescript/lib/typescript.js:90920:69)
    at transformNodeAndChildren (/home/pac/project/node_modules/typescript-is/lib/transform-inline/transformer.js:62:15)
Caused By: TypeError: Cannot create property 'pos' on string '_string'
    at setTextRangePos (/home/pac/project/node_modules/typescript/lib/typescript.js:21409:19)
    at Object.setTextRangePosEnd (/home/pac/project/node_modules/typescript/lib/typescript.js:21427:32)
    at createNodeArray (/home/pac/project/node_modules/typescript/lib/typescript.js:23022:16)
    at asNodeArray (/home/pac/project/node_modules/typescript/lib/typescript.js:27553:28)
    at createBaseGenericNamedDeclaration (/home/pac/project/node_modules/typescript/lib/typescript.js:23074:35)
    at createBaseSignatureDeclaration (/home/pac/project/node_modules/typescript/lib/typescript.js:23081:24)
    at createBaseFunctionLikeDeclaration (/home/pac/project/node_modules/typescript/lib/typescript.js:23101:24)
    at Object.createFunctionDeclaration (/home/pac/project/node_modules/typescript/lib/typescript.js:25401:24)
    at Object.createFunctionDeclaration (/home/pac/project/node_modules/typescript/lib/typescript.js:3324:29)
    at createAssertionFunction (/home/pac/project/node_modules/typescript-is/lib/transform-inline/visitor-utils.js:336:15) {
  nested: TypeError: Cannot create property 'pos' on string '_string'
      at setTextRangePos (/home/pac/project/node_modules/typescript/lib/typescript.js:21409:19)
      at Object.setTextRangePosEnd (/home/pac/project/node_modules/typescript/lib/typescript.js:21427:32)
      at createNodeArray (/home/pac/project/node_modules/typescript/lib/typescript.js:23022:16)
      at asNodeArray (/home/pac/project/node_modules/typescript/lib/typescript.js:27553:28)
      at createBaseGenericNamedDeclaration (/home/pac/project/node_modules/typescript/lib/typescript.js:23074:35)
      at createBaseSignatureDeclaration (/home/pac/project/node_modules/typescript/lib/typescript.js:23081:24)
      at createBaseFunctionLikeDeclaration (/home/pac/project/node_modules/typescript/lib/typescript.js:23101:24)
      at Object.createFunctionDeclaration (/home/pac/project/node_modules/typescript/lib/typescript.js:25401:24)
      at Object.createFunctionDeclaration (/home/pac/project/node_modules/typescript/lib/typescript.js:3324:29)
      at createAssertionFunction (/home/pac/project/node_modules/typescript-is/lib/transform-inline/visitor-utils.js:336:15)
}

As soon as I switch back to TypeScript 4.7.2 the errors go away.
The TypeScript peer dependency in the package.json should probably be something like this until the problem is solved then:

"typescript": ">=4.1.5 <4.7.2"

Instead of this (what it is currently):

"typescript": "^4.1.5"

which accepts TypeScript 4.8.2 as a version

@samchon
Copy link
Contributor

samchon commented Sep 4, 2022

It seems that typescript-is has stopped maintaining.

Therefore, I've made a competitive library and enhanced much more features.

https://github.com/samchon/typia

The new library works on TS 4.8

@SunHuawei
Copy link

Same issue here

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