Skip to content

[BUG] [alpha] Repo validator/import scan treats package-lock.json as a directory #37911

Description

@prinrevo

Project

ide

Description

During the validation/import scan, the validator attempts to traverse package-lock.json as if it were a folder/directory. In the repository, package-lock.json is a file (not a directory). This causes incorrect scanning behavior (and can lead to wrong “component not found / invalid” results).

Error Message

ENOTDIR: not a directory, scandir '<...>/package-lock.json'

Debug Logs

The full path the validator tried to recurse into for package-lock.json
The stack trace or the log line that mentions “scandir/readdir/walk” on package-lock.json

System Information

OS: Windows 11

Screenshots

Image Image

Steps to Reproduce

  1. Run the bounty validator/import scan on a project/repo containing a root package-lock.json
  2. Observe the validator traversal step
  3. It recurses/scans package-lock.json as if it were a folder

Expected Behavior

Validator recognizes package-lock.json is a file and does not recurse into it
Traversal continues with directories only

Actual Behavior

Validator attempts directory traversal on package-lock.json
Leads to incorrect validation results or traversal errors

Additional Context

The scan logic calls directory traversal (fs.readdirSync / scandir / recursive walk) without confirming the target path is a directory. Fix is to stat/check isDirectory() before recursing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingideIssues related to IDEinvalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions