tsdx icon indicating copy to clipboard operation
tsdx copied to clipboard

Parsing error: Cannot read property 'map' of undefined

Open olessavluk opened this issue 4 years ago • 5 comments

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

olessavluk avatar May 21 '21 11:05 olessavluk

Getting the same behaviour...

Any ideas on this @jaredpalmer ?

hamatoyogi avatar May 27 '21 11:05 hamatoyogi

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

jy95 avatar Aug 10 '21 20:08 jy95

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.

buzuosheng avatar Sep 17 '21 03:09 buzuosheng

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.

kyleshevlin avatar Oct 08 '21 18:10 kyleshevlin

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.

JeroenBos avatar Nov 23 '21 20:11 JeroenBos