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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict typescript version to <4 in @parcel/transformer-typescript-types #8494

Closed
joshocalico opened this issue Sep 21, 2022 · 3 comments
Closed

Comments

@joshocalico
Copy link

馃悰 bug report

馃帥 Configuration (.babelrc, package.json, cli command)

{
  // stock standard library config with the exclusion of types 
  "types": "dist/types/lib.d.ts"
  "devDependencies": { 
    ... 
    "parcel": "latest",
    "typescript": "^4.6.4", 
    ...
  }
}

馃 Expected Behavior

It should build correctly with correct generated types.

馃槸 Current Behavior

The build fails completely.

> parcel build


console: DeprecationWarning: 'updateBundle' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation 
context instead.

console: DeprecationWarning: 'getMutableClone' has been deprecated since v4.0.0. Use an appropriate `factory.update...` method instead, use `setCommentRange` or 
`setSourceMapRange`, and avoid setting `parent`.

console: 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.

console: DeprecationWarning: 'updateQualifiedName' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your 
transformation context instead.

console: DeprecationWarning: 'createModifier' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation 
context instead.

console: DeprecationWarning: 'createImportSpecifier' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your 
transformation context instead.

console: DeprecationWarning: 'createNamedImports' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your 
transformation context instead.

console: DeprecationWarning: 'createImportClause' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your 
transformation context instead.

console: DeprecationWarning: 'createLiteral' has been deprecated since v4.0.0. Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, 
馃毃 Build failed.

@parcel/transformer-typescript-types: Invalid arguments

  TypeError: Invalid arguments
      at Object.updateExportDeclaration (/Users/joshuasteele/fluidity/fluidity-app/web/surfing/node_modules/typescript/lib/typescript.js:170487:19)
      at Object.updateExportDeclaration (/Users/joshuasteele/fluidity/fluidity-app/web/surfing/node_modules/typescript/lib/typescript.js:171319:27)
      at Object.updateExportDeclaration (/Users/joshuasteele/fluidity/fluidity-app/web/surfing/node_modules/typescript/lib/typescript.js:3324:29)
      at visit (/Users/joshuasteele/fluidity/fluidity-app/web/surfing/node_modules/@parcel/transformer-typescript-types/lib/shake.js:113:42)
      at visitArrayWorker (/Users/joshuasteele/fluidity/fluidity-app/web/surfing/node_modules/typescript/lib/typescript.js:90658:48)
      at visitNodes (/Users/joshuasteele/fluidity/fluidity-app/web/surfing/node_modules/typescript/lib/typescript.js:90621:23)
      at Object.visitEachChild (/Users/joshuasteele/fluidity/fluidity-app/web/surfing/node_modules/typescript/lib/typescript.js:91131:56)
      at visit (/Users/joshuasteele/fluidity/fluidity-app/web/surfing/node_modules/@parcel/transformer-typescript-types/lib/shake.js:220:34)
      at visitNode (/Users/joshuasteele/fluidity/fluidity-app/web/surfing/node_modules/typescript/lib/typescript.js:90569:23)
      at Object.visitEachChild (/Users/joshuasteele/fluidity/fluidity-app/web/surfing/node_modules/typescript/lib/typescript.js:91128:166)

馃拋 Possible Solution

Restrict typescript dependency to less than version 4 as the API has changed.

馃敠 Context

I was unable to build our project with parcel.

馃捇 Code Sample

I believe any project with types in the package.json, TS to transform and typescript v4 will be able to reproduce this issue.

馃實 Your Environment

Software Version(s)
Parcel 2.7.0
Node 16.17.0
npm/Yarn npm 8.15.0
Operating System macOS Ventura (ARM)
@mischnic
Copy link
Member

mischnic commented Sep 24, 2022

See #8443 and #8419

Though the error messages here are different

@mischnic mischnic closed this as not planned Won't fix, can't repro, duplicate, stale Sep 24, 2022
@mischnic mischnic reopened this Sep 24, 2022
@mischnic
Copy link
Member

mischnic commented Nov 26, 2022

Also, can someone please provide a reproduction?

@mischnic
Copy link
Member

And/or: try it with the next nightly (which will include #8661) to see if it's working now.

@mischnic mischnic closed this as completed Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants