Skip to content

fix: --wait no longer hangs on self-hosted instances#75

Open
Luc0-0 wants to merge 1 commit intofirecrawl:mainfrom
Luc0-0:fix/wait-hangs-on-self-hosted
Open

fix: --wait no longer hangs on self-hosted instances#75
Luc0-0 wants to merge 1 commit intofirecrawl:mainfrom
Luc0-0:fix/wait-hangs-on-self-hosted

Conversation

@Luc0-0
Copy link

@Luc0-0 Luc0-0 commented Mar 25, 2026

What

firecrawl crawl <url> --wait hangs indefinitely when used against a self-hosted Firecrawl instance unless --progress is also passed.

Closes #3210

Root cause

The --wait path (without --progress) delegated to app.crawl() — the SDK's built-in convenience method that starts the crawl and waits internally. On self-hosted deployments this hangs because the SDK's polling mechanism is incompatible with self-hosted API instances.

The --wait --progress path already worked correctly because it used a manual getCrawlStatus() polling loop.

Fix

Removed the app.crawl() branch. Both --wait and --wait --progress now go through the same startCrawlgetCrawlStatus polling loop. Progress output to stderr is still gated behind --progress.

Before:
  --wait             → app.crawl()           ← hangs on self-hosted
  --wait --progress  → startCrawl + poll     ← works

After:
  --wait             → startCrawl + poll     ← works everywhere
  --wait --progress  → startCrawl + poll     ← works everywhere

Testing

  • Updated unit tests to reflect that --wait now uses startCrawl + getCrawlStatus instead of app.crawl()
  • Added test: --wait does not write progress to stderr
  • Added test: --wait returns timeout error correctly when crawl exceeds timeout
  • All 23 crawl tests pass

--wait without --progress delegates to app.crawl(), the SDK's built-in
convenience method. On self-hosted deployments this hangs indefinitely
because the SDK's internal polling mechanism is incompatible with
self-hosted API instances.

--wait --progress already works correctly because it uses a manual
getCrawlStatus() polling loop. This change makes --wait alone take the
same code path, removing the app.crawl() branch entirely.

Behaviour is unchanged for cloud API users. Progress output to stderr
is still gated behind the --progress flag.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant