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

Unable to build code containing TypeScript "named tuples" -- upgrade to TS 4 #1103

Closed
dragonman225 opened this issue Dec 11, 2021 · 1 comment
Labels
scope: dependencies Pull requests that update a dependency file solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue

Comments

@dragonman225
Copy link

Current Behavior

tsdx build failed with below error:

syntax error TS1005: ',' expected.

when building code containing "named tuples", like this:

/** Parameters that describe an arrow. */
export type ArrowDescriptor = [
  /** start point */
  sx: number,
  sy: number,
  /** control point for start point */
  c1x: number,
  c1y: number,
  /** control point for end point */
  c2x: number,
  c2y: number,
  /** end point */
  ex: number,
  ey: number,
  /** angle of end point */
  ae: number,
  /** angle of start point */
  as: number
]

the error pointed to the line sx: number,.

Expected behavior

tsdx build should build code containing "named tuples".

Suggested solution(s)

I guess there's something wrong in the rollup plugins tsdx is using. Probably upgrading them would fix.

Additional context

Staring from TypeScript 4.0, "named tuples" can be used to annotate parameters in an array.

Your environment

  System:
    OS: Linux 5.4 Manjaro Linux
    CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
    Memory: 447.06 MB / 15.48 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 15.14.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.7.6 - /usr/local/bin/npm
  Browsers:
    Chrome: Linux
    Chromium: 96.0.4664.45
    Firefox: 95.0
  npmPackages:
    tsdx: ^0.14.1 => 0.14.1 
    typescript: ^4.5.3 => 4.5.3 
  npmGlobalPackages:
    typescript: 4.0.8
@agilgur5 agilgur5 changed the title Unable to build code containing TypeScript "named tuples" Unable to build code containing TypeScript "named tuples" -- upgrade to TS 4 Apr 11, 2022
@agilgur5
Copy link
Collaborator

Staring from TypeScript 4.0

Duplicate of #926

@agilgur5 agilgur5 added solution: duplicate This issue or pull request already exists scope: dependencies Pull requests that update a dependency file solution: workaround available There is a workaround available for this issue labels Apr 11, 2022
Repository owner locked as resolved and limited conversation to collaborators Apr 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: dependencies Pull requests that update a dependency file solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue
Projects
None yet
Development

No branches or pull requests

2 participants