skott: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

I have the latest version of this tool installed, but it crashes every time I run it:

$ skott --version
skott, 0.28.0

 Skott exited with code 0

$ skott -s

 Running Skott from current directory: event-viewer
⠇ Initializing Skott
 Skott exited with code 1
node:internal/errors:490
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:399:5)
    at validateString (node:internal/validators:163:11)
    at Object.join (node:path:429:7)
    at resolveAliasToRelativePath (file:///C:/Users/kgetz/AppData/Roaming/nvm/v18.16.0/node_modules/skott/dist/src/modules/walkers/ecmascript/typescript/path-alias.js:10:36)
    at resolvePathAlias (file:///C:/Users/kgetz/AppData/Roaming/nvm/v18.16.0/node_modules/skott/dist/src/modules/walkers/ecmascript/typescript/path-alias.js:88:35)
    at EcmaScriptDependencyResolver.resolve (file:///C:/Users/kgetz/AppData/Roaming/nvm/v18.16.0/node_modules/skott/dist/src/modules/resolvers/ecmascript/resolver.js:113:40)
    at Skott.collectModuleDeclarations (file:///C:/Users/kgetz/AppData/Roaming/nvm/v18.16.0/node_modules/skott/dist/src/skott.js:213:47)
    at async Skott.buildFromRootDirectory (file:///C:/Users/kgetz/AppData/Roaming/nvm/v18.16.0/node_modules/skott/dist/src/skott.js:285:13)
    at async Skott.initialize (file:///C:/Users/kgetz/AppData/Roaming/nvm/v18.16.0/node_modules/skott/dist/src/skott.js:305:13)
    at async skott (file:///C:/Users/kgetz/AppData/Roaming/nvm/v18.16.0/node_modules/skott/dist/index.js:27:27) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v18.16.0

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

Hello @mattkindy,

Thanks for investigating! Performance is one of the next priorities I have in mind, this is why I started to add benchmarks in the CI to prepare the ground and being able to measure improvements over time.

Currently, lot of useless/avoidable work is done, I have few ideas in mind already, module resolution is one of them. As we say, performance can not only come from making things faster but also from getting rid of things (no thing will always be faster than a fast thing).

For the file system part, it’s interesting, I’ll take a look. Concurrency needs to be correctly managed for the graph to be consistent. When running skott from an entrypoint, I’m not sure we can make it more concurrent file-system wise as we incrementally discover the graph by visiting each node. However when using the bulk mode, that is traversing all files within a cwd, it might be worth it to enhance concurrency, I’ll take a look at it.

Also @mattkindy you’re always welcome to open PRs if you find any quick wins/improvements. I hadn’t the time to do that before but it does not mean that I’m not willing to integrate free perf boosts 😉

@kaiyoma great to know thanks. How many files does that hybrid repo contain?

We have about 5,700 files in the “single repo” directory and about 11,400 files total.

Does it hang forever or is it just very very slow?

I’m not sure. I let it run for 5 minutes and it was constantly churning (with respect to CPU usage) and never finished. If I run skott on just the single source directory (the one with 5,700 files), it finishes in about a minute.