Skip to content

fix(js-sdk): include ignoreRobotsTxt in crawl payload - #3962

Closed
sbalagan22 wants to merge 1 commit into
firecrawl:mainfrom
sbalagan22:fix/3940-crawl-ignorerobotstxt
Closed

sbalagan22 wants to merge 1 commit into
firecrawl:mainfrom
sbalagan22:fix/3940-crawl-ignorerobotstxt

Conversation

@sbalagan22

@sbalagan22 sbalagan22 commented Jul 7, 2026 •

Copy link
Copy Markdown

Summary

crawl() and startCrawl() in the JS SDK silently dropped the ignoreRobotsTxt option: it is declared in CrawlOptions and supported by the API, but was never written into the request body. This wires the field into the crawl payload so it reaches POST /v2/crawl.

Root cause

prepareCrawlPayload() in apps/js-sdk/firecrawl/src/v2/methods/crawl.ts builds the request body field by field. It has a line for robotsUserAgent but none for ignoreRobotsTxt, even though both were added to CrawlOptions together. robotsUserAgent had its own missing-payload line fixed in #3403; ignoreRobotsTxt sat on the adjacent line and was missed. Because the field was never copied into data, the request went out without it and the crawl behaved as if the option was never passed. The Python SDK forwards this field, so the two SDKs disagreed.

Fix

Add one line forwarding request.ignoreRobotsTxt into the payload, placed next to robotsUserAgent and guarded by the same != null check every sibling field uses. This keeps the undefined case out of the body (matching the existing pattern) rather than always sending the key. Version bumped to 4.29.3, matching the patch-bump convention of #3403.

Test plan

Added apps/js-sdk/firecrawl/src/__tests__/unit/v2/crawl.unit.test.ts (mirroring extract.unit.test.ts): a mocked HttpClient.post captures the payload. One test asserts ignoreRobotsTxt: true reaches the /v2/crawl body; one asserts it is omitted when unset. The first test fails on the base branch (payload lacks the field) and passes with the fix.

$ NODE_OPTIONS=--experimental-vm-modules npx jest --verbose src/__tests__/unit/v2/crawl.unit.test.ts
PASS src/__tests__/unit/v2/crawl.unit.test.ts
  v2.crawl unit
    ok startCrawl forwards ignoreRobotsTxt in request payload
    ok startCrawl omits ignoreRobotsTxt when not set
Tests:       2 passed, 2 total

npx tsup builds cleanly (JS + DTS). tsc --noEmit reports no errors in the changed file; the 8 pre-existing errors in feedback.ts, monitor.ts, and validation.ts are present on the base branch and untouched here.

Fixes #3940


Summary by cubic

Forward ignoreRobotsTxt in JS SDK crawl requests so /v2/crawl respects the option. Aligns behavior with the API and Python SDK; addresses #3940.

  • Bug Fixes
    • Send ignoreRobotsTxt in the crawl payload when provided.
    • Add unit tests to verify the field is forwarded or omitted correctly.
    • Bump @mendable/firecrawl-js to 4.29.3.

Written for commit 24ccd73. Summary will update on new commits.

Review in cubic

prepareCrawlPayload was dropping the ignoreRobotsTxt field before sending
to /v2/crawl, so crawl() and startCrawl() silently ignored the option even
though it is declared in CrawlOptions and supported by the API. Add it to
the payload next to robotsUserAgent (the same omission fixed in firecrawl#3403) and
bump to 4.29.3.
@capy-ai

capy-ai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Closing as a duplicate of #3959, which covers the same one-line ignoreRobotsTxt forward in the v2 crawl payload; thanks for the contribution.

@capy-ai capy-ai Bot closed this Sep 30, 2026
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.

[Bug] JS SDK v2 crawl() silently drops ignoreRobotsTxt option

1 participant