fix(linkedom-crawler): declare cheerio as a dependency#3620
Merged
Conversation
`linkedom-crawler.ts` does `import * as cheerio from 'cheerio'`, but `cheerio` was not declared in `@crawlee/linkedom`'s dependencies. The package built/published fine because cheerio is hoisted to the crawlee monorepo root via other workspaces (`@crawlee/cheerio`, `@crawlee/utils`, `@crawlee/http`, etc.), so resolution always found it during dev. Downstream installs that don't pull any of those packages — e.g. an SDK that depends only on `crawlee` and re-exports `@crawlee/linkedom` through it — fail at runtime with `Cannot find package 'cheerio'` the moment Node resolves the import. Declaring cheerio explicitly makes the package self-contained.
B4nan
added a commit
to apify/apify-sdk-js
that referenced
this pull request
Apr 30, 2026
`@crawlee/linkedom@4.0.0-beta.51` now declares cheerio as a direct dependency (apify/crawlee#3620), so the SDK no longer has to ship its own cheerio devDep to mask the missing declaration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/linkedom-crawler/src/internals/linkedom-crawler.tsimportscheerio(import * as cheerio from 'cheerio') but@crawlee/linkedom'spackage.jsondoesn't list it as a dependency.It works inside the monorepo because cheerio is hoisted to the workspace root via other packages (
@crawlee/cheerio,@crawlee/utils,@crawlee/http, …), so Node always finds it. Downstream installs that depend only oncrawlee(which re-exports@crawlee/linkedom) and don't pull any cheerio-using sibling fail at runtime:This bit the apify-sdk-js v4 catch-up PRs (apify/apify-sdk-js#597) on a clean CI install — without this fix, every consumer has to ship a
cheeriodev-dep workaround.The fix is one-line: declare
cheerio: "^1.0.0"(matching what@crawlee/cheerioalready pins).