Skip to content

CLI freezes on large projects due to recursive search in frontendlib.js #405

@SARTHAK2427

Description

@SARTHAK2427

Description

The CLI becomes unresponsive when running commands in projects with a large number of files inside the resources directory, this is caused by a recursive file scan in makeClientLibUrl which searches the entire directory tree to locate neutralino.js.

Steps to reproduce the delay

  1. Initialize a new project:
neu create test-app
cd test-app
  1. Simulate a large project structure:
mkdir resources/test-package
# On Windows (PowerShell):
for ($i=1; $i -le 10000; $i++) { New-Item -Path "resources/test-package/file_$i.txt" -ItemType "file" -Value "test" }
  1. Run the application:
neu run
  1. Observe the delay: You will notice a significant hang before the Neutralino window appears. This is because the CLI is recursively scanning all 10,000+ files to find neutralino.js, even though it is typically located in the root of the resources folder.

Expected Behavior:

  • CLI should start almost instantly
  • No noticeable delay regardless of file count

Actual Behavior:

  • CLI freezes for several seconds before starting
  • No output during the delay
  • Time increases with number of files

I reproduced this issue on my system by generating ~10,000 files inside the resources directory using CMD and observed a 3-5 sec delay which can grow to minutes for larger projects

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