Skip to content

errors when running auto command without argument #673

Closed

Description

@ErwanRaulo

version

cli 3.1.0
node 24

command

nsecure auto

issue

optional dependency [dep] as argument throws errors like those in the attached file

cli-issue.txt

  • investigate, but we should at least pretty print TypeError without stack trace, for example:
error name: tarball.scanDirOrArchive bare-os@3.7.1
Message: Cannot read properties of undefined (reading 'get')
The error occured during the tarball-scan phase
The error occured at 9ms during the execution
Stack: TypeError: Cannot read properties of undefined (reading 'get')
    at AstAnalyser.getCollectableSet (@nodesecure/tarball/node_modules/@nodesecure/js-x-ray/dist/AstAnalyser.js:219:45)
    at #analyseFile (@nodesecure/tarball/node_modules/@nodesecure/js-x-ray/dist/EntryFilesAnalyser.js:86:48)
    at #analyseFile.next (<anonymous>)
    at EntryFilesAnalyser.analyse (@nodesecure/tarball/node_modules/@nodesecure/js-x-ray/dist/EntryFilesAnalyser.js:46:37)
    at analyse.next (<anonymous>)
    at #iterateWithEntries (@nodesecure/tarball/dist/class/SourceCodeScanner.class.js:58:26)
    at async NpmTarball.scanFiles (@nodesecure/tarball/dist/class/NpmTarball.class.js:41:20)
    at async scanDirOrArchive (@nodesecure/tarball/dist/tarball.js:24:48)
    at async scanDirOrArchiveEx (@nodesecure/scanner/dist/depWalker.js:309:5)
    at async Promise.allSettled (index 1124)

Activity

  1. clemgbld commented on Mar 5, 2026

    @clemgbld
    Member

    @ErwanRaulo That is not because you didn't pass a spec, these error are logs implemented in this PR

    @fraxken maybe we should show the stack trace only in verbose, wdyt ?

  2. fraxken commented on Mar 5, 2026

    @fraxken
    Member

    Yup why not, need to check what's up with the error in AstAnalyser

  3. fraxken commented on Mar 20, 2026

    @fraxken
    Member

    Should be fixed with recent updates (or the one coming in #677)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions