jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.21k stars 505 forks source link

Parsing error: Cannot read property 'map' of undefined #1033

Open olessavluk opened 3 years ago

olessavluk commented 3 years ago

Current Behavior

export type Tuple = [number, number];

after running yarn lint getting error 0:0 error Parsing error: Cannot read property 'map' of undefined. Build and test commands work fine.

Additional context

Tried the same in Create React App, seems to be working fine.

Your environment

  System:
    OS: macOS 10.15.7
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 870.95 MB / 16.00 GB
    Shell: 3.1.2 - /opt/local/bin/fish
  Binaries:
    Node: 14.15.3 - ~/.nvm/versions/node/v14.15.3/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.3/bin/yarn
    npm: 7.7.2 - ~/.nvm/versions/node/v14.15.3/bin/npm
    Watchman: 4.9.0 - /opt/local/bin/watchman
  Browsers:
    Chrome: 90.0.4430.212
    Firefox: 87.0
    Firefox Developer Edition: 89.0
    Safari: 14.1
  npmPackages:
    tsdx: 0.14.1 => 0.14.1 
    typescript: 4.2.4 => 4.2.4
hamatoyogi commented 3 years ago

Getting the same behaviour...

Any ideas on this @jaredpalmer ?

jy95 commented 2 years ago

Same for me : this kind of workaround didn't work ( https://github.com/formium/tsdx/issues/926#issuecomment-751936109 ) either

buzuosheng commented 2 years ago

I dont wirte 'map' in my file, so i cant understand why i have such a problem. And i dont find any way to fix it. i just replace it with 'eslint' finally.

kyleshevlin commented 2 years ago

I am encountering this issue, too. It's a bit of a pain given that lint runs in the github actions. It's a parsing error, so my instinct was to switch the parser to @typescript-eslint/parser but that hasn't done the trick.

JeroenBos commented 2 years ago

This is the corresponding SO question.

The workaround is to not use tuple types, or move over to a package that is not stale like dts-cli.