You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
I'm trying to run depcheck against TypeScript code but it's failing with the error: TypeError: p is not iterable. I've tried installing with npm i -g depcheck and also npm i -g depcheck typescript.
The error was generated after running:
depcheck path/to/my/repo --json
I have tried:
depcheck path/to/my/repo --parsers="*.ts" --json
However, when I run this (^) command I get the error: Cannot read property 'split' of undefined. It does seem to be working as expected for .js files though.
Here's the stack trace for the error in the issue title.
"TypeError: p is not iterable\n at /Users/danielreid/.nvm/versions/node/v14.18.2/lib/node_modules/depcheck/node_modules/@babel/parser/lib/index.js:10658:43\n at Array.some (<anonymous>)\n at hasPlugin (/Users/danielreid/.nvm/versions/node/v14.18.2/lib/node_modules/depcheck/node_modules/@babel/parser/lib/index.js:10654:18)\n at validatePlugins (/Users/danielreid/.nvm/versions/node/v14.18.2/lib/node_modules/depcheck/node_modules/@babel/parser/lib/index.js:10693:7)\n at getParser (/Users/danielreid/.nvm/versions/node/v14.18.2/lib/node_modules/depcheck/node_modules/@babel/parser/lib/index.js:15283:5)\n at parse (/Users/danielreid/.nvm/versions/node/v14.18.2/lib/node_modules/depcheck/node_modules/@babel/parser/lib/index.js:15254:12)\n at parseTypescript (/Users/danielreid/.nvm/versions/node/v14.18.2/lib/node_modules/depcheck/dist/parser/typescript.js:17:28)\n at async getDependencies (/Users/danielreid/.nvm/versions/node/v14.18.2/lib/node_modules/depcheck/dist/check.js:71:18)"
Versions
node -v: v14.18.2
npm -v: 6.14.15
depcheck --version: 1.4.2
slavoroi and capsulemanslavoroislavoroislavoroislavoroislavoroislavoroi