Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

refactor: drop re-exported types from `@crawlee/utils` (#3931)

Jindřich Bärfc2930f2ae33
diff --git a/docs/public-api/crawlee-browser.api.md b/docs/public-api/crawlee-browser.api.md
index 9544d84fc..d8e93691a 100644
--- a/docs/public-api/crawlee-browser.api.md
+++ b/docs/public-api/crawlee-browser.api.md
@@ -6,7 +6,7 @@
import { AnyPredicate } from 'ow';
import { ArrayPredicate } from 'ow';
-import type { Awaitable } from '@crawlee/basic';
+import type { Awaitable } from '@crawlee/types';
import { BasePredicate } from 'ow';
import { BasicCrawler } from '@crawlee/basic';
import type { BasicCrawlerOptions } from '@crawlee/basic';
@@ -20,12 +20,11 @@ import type { BrowserPoolHooks } from '@crawlee/browser-pool';
import type { BrowserPoolOptions } from '@crawlee/browser-pool';
import type { CommonPage } from '@crawlee/browser-pool';
import { Configuration } from '@crawlee/basic';
-import type { Constructor } from '@crawlee/utils';
+import type { Constructor } from '@crawlee/types';
import { ContextPipeline } from '@crawlee/basic';
import type { CrawlerRemoteBrowserOptions } from '@crawlee/browser-pool';
import type { CrawlingContext } from '@crawlee/basic';
-import type { Dictionary } from '@crawlee/basic';
-import type { Dictionary as Dictionary_2 } from '@crawlee/utils';
+import type { Dictionary } from '@crawlee/types';
import type { EnqueueLinksOptions } from '@crawlee/basic';
import type { ErrorHandler } from '@crawlee/basic';
import type { GetUserDataFromRequest } from '@crawlee/basic';
diff --git a/docs/public-api/crawlee-core.api.md b/docs/public-api/crawlee-core.api.md
index af1b87dc7..6fadfca49 100644
--- a/docs/public-api/crawlee-core.api.md
+++ b/docs/public-api/crawlee-core.api.md
@@ -4,16 +4,16 @@
```ts
-import { AllowedHttpMethods } from '@crawlee/types';
+import type { AllowedHttpMethods } from '@crawlee/types';
import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
-import { Awaitable } from '@crawlee/types';
+import type { Awaitable } from '@crawlee/types';
import type { BaseHttpClient } from '@crawlee/types';
import type { BatchAddRequestsResult } from '@crawlee/types';
import type { BetterIntervalID } from '@apify/utilities';
import type { BinaryLike } from 'node:crypto';
-import { Constructor } from '@crawlee/types';
-import { Cookie } from '@crawlee/types';
-import { Cookie as Cookie_2 } from 'tough-cookie';
+import type { Constructor } from '@crawlee/types';
+import { Cookie } from 'tough-cookie';
+import type { Cookie as Cookie_2 } from '@crawlee/types';
import { CookieJar } from 'tough-cookie';
import { CrawleeLogger } from '@crawlee/types';
import type { CrawleeLoggerOptions } from '@crawlee/types';
@@ -37,7 +37,7 @@ import { ParseSitemapOptions } from '@crawlee/utils';
import type { ProcessedRequest } from '@crawlee/types';
import type { ProxyInfo } from '@crawlee/types';
import { PseudoUrl } from '@apify/pseudo_url';
-import { QueueOperationInfo } from '@crawlee/types';
+import type { QueueOperationInfo } from '@crawlee/types';
import { Readable } from 'node:stream';
import type { ReadonlyDeep } from 'type-fest';
import type { RequestQueueBackend } from '@crawlee/types';
@@ -109,8 +109,6 @@ export interface AutoscaledPoolPredicateOptions {
isTaskReadyFunction?: () => Promise<boolean>;
}
-export { Awaitable }
-
// @public
export abstract class BaseCrawleeLogger implements CrawleeLogger {
constructor(options?: Partial<CrawleeLoggerOptions>);
@@ -254,8 +252,6 @@ export type ConfigurationInput = FieldsInput<typeof crawleeConfigFields>;
// @public @deprecated (undocumented)
export type ConfigurationOptions = ConfigurationInput;
-export { Constructor }
-
// @public
export interface ContextMiddleware<TCrawlingContext, TCrawlingContextExtension> {
action: (context: TCrawlingContext) => Awaitable<TCrawlingContextExtension>;
@@ -285,8 +281,6 @@ export class ContextPipelineInterruptedError extends Error {
constructor(message?: string);
}
-export { Cookie }
-
// @public
export class CpuLoadSignal implements LoadSignal {
constructor(options?: CpuLoadSignalOptions);
@@ -391,7 +385,7 @@ export class Dataset<Data extends Dictionary = Dictionary> {
// @public
export interface DatasetConsumer<Data> {
// (undocumented)
- (item: Data, index: number): Awaitable_2<void>;
+ (item: Data, index: number): Awaitable<void>;
}
// @public (undocumented)
@@ -435,7 +429,7 @@ export interface DatasetIteratorOptions extends Omit<DatasetDataOptions, 'offset
// @public
export interface DatasetMapper<Data, R> {
- (item: Data, index: number): Awaitable_2<R>;
+ (item: Data, index: number): Awaitable<R>;
}
// @public (undocumented)
@@ -448,7 +442,7 @@ export interface DatasetOptions {
// @public
export interface DatasetReducer<T, Data> {
// (undocumented)
- (memo: T, item: Data, index: number): Awaitable_2<T>;
+ (memo: T, item: Data, index: number): Awaitable<T>;
}
// @public
@@ -470,8 +464,6 @@ export interface DefaultStorageIdentifier {
name?: never;
}
-export { Dictionary }
-
// @public
export function enqueueLinks(options: SetRequired<Omit<EnqueueLinksOptions, 'requestManager'>, 'urls'> & {
requestManager: {
@@ -778,7 +770,7 @@ export interface KeyConsumer {
// (undocumented)
(key: string, index: number, info: {
size: number;
- }): Awaitable_2<void>;
+ }): Awaitable<void>;
}
// @public
@@ -1021,8 +1013,6 @@ export interface PushErrorMessageOptions {
omitStack?: boolean;
}
-export { QueueOperationInfo }
-
// @public (undocumented)
export interface RecordOptions {
contentType?: string;
@@ -1367,22 +1357,22 @@ export class RetryRequestError extends Error {
// @public
export class Router<Context extends Omit<RestrictedCrawlingContext, 'enqueueLinks'>, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<Context['request']>>> {
- addDefaultHandler<UserData extends Dictionary = DefaultRouteUserData<Routes, GetUserDataFromRequest<Context['request']>>>(handler: (ctx: RouterHandlerContext<Context, UserData, Routes>) => Awaitable_2<void>): void;
- addHandler<Label extends keyof Routes & string>(label: Label, handler: (ctx: RouterHandlerContext<Context, Routes[Label], Routes>) => Awaitable_2<void>): void;
- addHandler<UserData extends Dictionary = GetUserDataFromRequest<Context['request']>>(label: RouterLabel<Routes>, handler: (ctx: RouterHandlerContext<Context, UserData, Routes>) => Awaitable_2<void>): void;
+ addDefaultHandler<UserData extends Dictionary = DefaultRouteUserData<Routes, GetUserDataFromRequest<Context['request']>>>(handler: (ctx: RouterHandlerContext<Context, UserData, Routes>) => Awaitable<void>): void;
+ addHandler<Label extends keyof Routes & string>(label: Label, handler: (ctx: RouterHandlerContext<Context, Routes[Label], Routes>) => Awaitable<void>): void;
+ addHandler<UserData extends Dictionary = GetUserDataFromRequest<Context['request']>>(label: RouterLabel<Routes>, handler: (ctx: RouterHandlerContext<Context, UserData, Routes>) => Awaitable<void>): void;
static create<Context extends Omit<RestrictedCrawlingContext, 'enqueueLinks'> = CrawlingContext, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<Context['request']>>>(routes?: RouterRoutes<Context, Routes>): RouterHandler<Context, Routes>;
// (undocumented)
static create<Context extends Omit<RestrictedCrawlingContext, 'enqueueLinks'> = CrawlingContext, UserData extends Dictionary = GetUserDataFromRequest<Context['request']>>(routes?: RouterRoutes<Context, Record<string, UserData>>): RouterHandler<Context, Record<string, UserData>>;
// (undocumented)
static create<Context extends Omit<RestrictedCrawlingContext, 'enqueueLinks'> = CrawlingContext, const Schemas extends RouteSchemas = RouteSchemas>(schemas: Schemas): RouterHandler<Context, RoutesFromSchemas<Schemas>>;
- getHandler(label?: string | symbol): (ctx: Context) => Awaitable_2<void>;
- use(middleware: (ctx: Context) => Awaitable_2<void>): void;
+ getHandler(label?: string | symbol): (ctx: Context) => Awaitable<void>;
+ use(middleware: (ctx: Context) => Awaitable<void>): void;
}
// @public (undocumented)
export interface RouterHandler<Context extends Omit<RestrictedCrawlingContext, 'enqueueLinks'> = CrawlingContext, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<Context['request']>>> extends Router<Context, Routes> {
// (undocumented)
- (ctx: Context): Awaitable_2<void>;
+ (ctx: Context): Awaitable<void>;
}
// @public
@@ -1402,7 +1392,7 @@ export type RouterLabel<Routes extends Record<keyof Routes, Dictionary>> = strin
export type RouterRoutes<Context, Routes extends Record<keyof Routes, Dictionary>> = {
[Label in keyof Routes]: (ctx: Omit<Context, 'request'> & {
request: Request_2<Routes[Label]>;
- }) => Awaitable_2<void>;
+ }) => Awaitable<void>;
};
// @public
@@ -1792,7 +1782,7 @@ export interface UseStateOptions {
}
// @public
-export const withCheckedStorageAccess: <T>(checkFunction: () => void, callback: () => Awaitable_2<T>) => Promise<T>;
+export const withCheckedStorageAccess: <T>(checkFunction: () => void, callback: () => Awaitable<T>) => Promise<T>;
// (No @packageDocumentation comment for this package)
diff --git a/docs/public-api/crawlee-playwright.api.md b/docs/public-api/crawlee-playwright.api.md
index d0d132e15..a93237990 100644
--- a/docs/public-api/crawlee-playwright.api.md
+++ b/docs/public-api/crawlee-playwright.api.md
@@ -29,8 +29,7 @@ import { ContextPipeline } from '@crawlee/browser';
import type { ContextPipeline as ContextPipeline_2 } from '@crawlee/core';
import { CrawlingContext } from '@crawlee/browser';
import type { CrawlingContext as CrawlingContext_2 } from '@crawlee/core';
-import { Dictionary } from '@crawlee/utils';
-import type { Dictionary as Dictionary_2 } from '@crawlee/types';
+import type { Dictionary } from '@crawlee/types';
import type { Download } from 'playwright';
import type { EnqueueLinksOptions } from '@crawlee/core';
import type { GetUserDataFromRequest } from '@crawlee/browser';
@@ -65,11 +64,11 @@ import type { StatisticState } from '@crawlee/core';
import { StringPredicate } from 'ow';
// @public
-export class AdaptivePlaywrightCrawler<ContextExtension = Dictionary_2<never>, ExtendedContext extends AdaptivePlaywrightCrawlerContext = AdaptivePlaywrightCrawlerContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary_2> = Record<string, GetUserDataFromRequest_2<AdaptivePlaywrightCrawlerContext['request']>>> extends BasicCrawler<AdaptivePlaywrightCrawlerContext, ContextExtension, ExtendedContext, Routes> {
+export class AdaptivePlaywrightCrawler<ContextExtension = Dictionary<never>, ExtendedContext extends AdaptivePlaywrightCrawlerContext = AdaptivePlaywrightCrawlerContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest_2<AdaptivePlaywrightCrawlerContext['request']>>> extends BasicCrawler<AdaptivePlaywrightCrawlerContext, ContextExtension, ExtendedContext, Routes> {
constructor(options?: AdaptivePlaywrightCrawlerOptions<ContextExtension, ExtendedContext, Routes>);
// (undocumented)
- protected buildContextPipeline(): ContextPipeline_2<CrawlingContext_2<Dictionary_2>, CrawlingContext_2<Dictionary_2> & {
- readonly request: LoadedRequest<Request_3<Dictionary_2>>;
+ protected buildContextPipeline(): ContextPipeline_2<CrawlingContext_2<Dictionary>, CrawlingContext_2<Dictionary> & {
+ readonly request: LoadedRequest<Request_3<Dictionary>>;
readonly response: Response;
readonly page: Page;
readonly querySelector: AdaptivePlaywrightCrawlerContext["querySelector"];
@@ -89,7 +88,7 @@ export class AdaptivePlaywrightCrawler<ContextExtension = Dictionary_2<never>, E
}
// @public (undocumented)
-export interface AdaptivePlaywrightCrawlerContext<UserData extends Dictionary_2 = Dictionary_2> extends CrawlingContext_2<UserData> {
+export interface AdaptivePlaywrightCrawlerContext<UserData extends Dictionary = Dictionary> extends CrawlingContext_2<UserData> {
// (undocumented)
enqueueLinks(options?: EnqueueLinksOptions): Promise<unknown>;
page: Page;
@@ -103,7 +102,7 @@ export interface AdaptivePlaywrightCrawlerContext<UserData extends Dictionary_2
}
// @public (undocumented)
-export interface AdaptivePlaywrightCrawlerOptions<ContextExtension = Dictionary_2<never>, ExtendedContext extends AdaptivePlaywrightCrawlerContext = AdaptivePlaywrightCrawlerContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary_2> = Record<string, GetUserDataFromRequest_2<AdaptivePlaywrightCrawlerContext['request']>>> extends Omit<BasicCrawlerOptions<AdaptivePlaywrightCrawlerContext, ContextExtension, ExtendedContext, Routes>, 'preNavigationHooks' | 'postNavigationHooks'> {
+export interface AdaptivePlaywrightCrawlerOptions<ContextExtension = Dictionary<never>, ExtendedContext extends AdaptivePlaywrightCrawlerContext = AdaptivePlaywrightCrawlerContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest_2<AdaptivePlaywrightCrawlerContext['request']>>> extends Omit<BasicCrawlerOptions<AdaptivePlaywrightCrawlerContext, ContextExtension, ExtendedContext, Routes>, 'preNavigationHooks' | 'postNavigationHooks'> {
postNavigationHooks?: AdaptivePostNavigationHook<ContextExtension>[];
preNavigationHooks?: AdaptiveHook<ContextExtension>[];
preventDirectStorageAccess?: boolean;
@@ -141,19 +140,19 @@ interface CompiledScriptParams {
function compileScript(scriptString: string, context?: Dictionary): CompiledScriptFunction;
// @public (undocumented)
-export function createAdaptivePlaywrightRouter<Context extends AdaptivePlaywrightCrawlerContext = AdaptivePlaywrightCrawlerContext, Routes extends Record<keyof Routes, Dictionary_2> = Record<string, GetUserDataFromRequest_2<Context['request']>>>(routes?: RouterRoutes_2<Context, Routes>): RouterHandler<Context, Routes>;
+export function createAdaptivePlaywrightRouter<Context extends AdaptivePlaywrightCrawlerContext = AdaptivePlaywrightCrawlerContext, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest_2<Context['request']>>>(routes?: RouterRoutes_2<Context, Routes>): RouterHandler<Context, Routes>;
// @public (undocumented)
-export function createAdaptivePlaywrightRouter<Context extends AdaptivePlaywrightCrawlerContext = AdaptivePlaywrightCrawlerContext, UserData extends Dictionary_2 = GetUserDataFromRequest_2<Context['request']>>(routes?: RouterRoutes_2<Context, Record<string, UserData>>): RouterHandler<Context, Record<string, UserData>>;
+export function createAdaptivePlaywrightRouter<Context extends AdaptivePlaywrightCrawlerContext = AdaptivePlaywrightCrawlerContext, UserData extends Dictionary = GetUserDataFromRequest_2<Context['request']>>(routes?: RouterRoutes_2<Context, Record<string, UserData>>): RouterHandler<Context, Record<string, UserData>>;
// @public (undocumented)
export function createAdaptivePlaywrightRouter<Context extends AdaptivePlaywrightCrawlerContext = AdaptivePlaywrightCrawlerContext, const Schemas extends RouteSchemas = RouteSchemas>(schemas: Schemas): RouterHandler<Context, RoutesFromSchemas<Schemas>>;
// @public
-export function createPlaywrightRouter<Context extends PlaywrightCrawlingContext = PlaywrightCrawlingContext, Routes extends Record<keyof Routes, Dictionary_2> = Record<string, GetUserDataFromRequest<Context['request']>>>(routes?: RouterRoutes<Context, Routes>): RouterHandler<Context, Routes>;
+export function createPlaywrightRouter<Context extends PlaywrightCrawlingContext = PlaywrightCrawlingContext, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<Context['request']>>>(routes?: RouterRoutes<Context, Routes>): RouterHandler<Context, Routes>;
// @public (undocumented)
-export function createPlaywrightRouter<Context extends PlaywrightCrawlingContext = PlaywrightCrawlingContext, UserData extends Dictionary_2 = GetUserDataFromRequest<Context['request']>>(routes?: RouterRoutes<Context, Record<string, UserData>>): RouterHandler<Context, Record<string, UserData>>;
+export function createPlaywrightRouter<Context extends PlaywrightCrawlingContext = PlaywrightCrawlingContext, UserData extends Dictionary = GetUserDataFromRequest<Context['request']>>(routes?: RouterRoutes<Context, Record<string, UserData>>): RouterHandler<Context, Record<string, UserData>>;
// @public (undocumented)
export function createPlaywrightRouter<Context extends PlaywrightCrawlingContext = PlaywrightCrawlingContext, const Schemas extends RouteSchemas = RouteSchemas>(schemas: Schemas): RouterHandler<Context, RoutesFromSchemas<Schemas>>;
@@ -178,7 +177,7 @@ interface EnqueueLinksByClickingElementsOptions {
selector: string;
skipNavigation?: boolean;
transformRequestFunction?: RequestTransform;
- userData?: Dictionary_2;
+ userData?: Dictionary;
waitForPageIdleSecs?: number;
}
@@ -259,12 +258,12 @@ declare namespace playwrightClickElements {
}
// @public
-export class PlaywrightCrawler<ContextExtension = Dictionary_2<never>, ExtendedContext extends PlaywrightCrawlingContext = PlaywrightCrawlingContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary_2> = Record<string, GetUserDataFromRequest<PlaywrightCrawlingContext['request']>>> extends BrowserCrawler<Page, Response_2, {
+export class PlaywrightCrawler<ContextExtension = Dictionary<never>, ExtendedContext extends PlaywrightCrawlingContext = PlaywrightCrawlingContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<PlaywrightCrawlingContext['request']>>> extends BrowserCrawler<Page, Response_2, {
browserPlugins: [PlaywrightPlugin];
}, LaunchOptions, PlaywrightCrawlingContext, ContextExtension, ExtendedContext, Routes> {
constructor(options?: PlaywrightCrawlerOptions<ContextExtension, ExtendedContext, Routes>);
// (undocumented)
- protected buildContextPipeline(): ContextPipeline<CrawlingContext<Dictionary_2>, BrowserCrawlingContext<Page, Response_2, Dictionary_2, Dictionary_2> & {
+ protected buildContextPipeline(): ContextPipeline<CrawlingContext<Dictionary>, BrowserCrawlingContext<Page, Response_2, Dictionary, Dictionary> & {
injectFile: (filePath: string, options?: InjectFileOptions) => Promise<unknown>;
injectJQuery: () => Promise<void>;
blockRequests: (options?: BlockRequestsOptions) => Promise<void>;
@@ -274,7 +273,7 @@ export class PlaywrightCrawler<ContextExtension = Dictionary_2<never>, ExtendedC
listDownloads: () => Promise<Download[]>;
saveSnapshot: (options?: SaveSnapshotOptions) => Promise<void>;
enqueueLinksByClickingElements: (options: Omit<EnqueueLinksByClickingElementsOptions, "page" | "requestManager">) => Promise<BatchAddRequestsResult>;
- compileScript: (scriptString: string, ctx?: Dictionary_2) => CompiledScriptFunction;
+ compileScript: (scriptString: string, ctx?: Dictionary) => CompiledScriptFunction;
closeCookieModals: () => Promise<void>;
handleCloudflareChallenge: (options?: HandleCloudflareChallengeOptions) => Promise<Response_2 | undefined>;
}>;
@@ -333,7 +332,7 @@ export class PlaywrightCrawler<ContextExtension = Dictionary_2<never>, ExtendedC
}
// @public (undocumented)
-export interface PlaywrightCrawlerOptions<ContextExtension = Dictionary_2<never>, ExtendedContext extends PlaywrightCrawlingContext = PlaywrightCrawlingContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary_2> = Record<string, GetUserDataFromRequest<PlaywrightCrawlingContext['request']>>> extends BrowserCrawlerOptions<Page, Response_2, PlaywrightCrawlingContext, ContextExtension, ExtendedContext, {
+export interface PlaywrightCrawlerOptions<ContextExtension = Dictionary<never>, ExtendedContext extends PlaywrightCrawlingContext = PlaywrightCrawlingContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<PlaywrightCrawlingContext['request']>>> extends BrowserCrawlerOptions<Page, Response_2, PlaywrightCrawlingContext, ContextExtension, ExtendedContext, {
browserPlugins: [PlaywrightPlugin];
}, Routes> {
launchContext?: PlaywrightLaunchContext;
@@ -343,7 +342,7 @@ export interface PlaywrightCrawlerOptions<ContextExtension = Dictionary_2<never>
}
// @public (undocumented)
-export interface PlaywrightCrawlingContext<UserData extends Dictionary_2 = Dictionary_2> extends BrowserCrawlingContext<Page, Response_2, UserData, PlaywrightGotoOptions>, PlaywrightContextUtils {
+export interface PlaywrightCrawlingContext<UserData extends Dictionary = Dictionary> extends BrowserCrawlingContext<Page, Response_2, UserData, PlaywrightGotoOptions>, PlaywrightContextUtils {
}
// @public (undocumented)
diff --git a/docs/public-api/crawlee-utils.api.md b/docs/public-api/crawlee-utils.api.md
index 6e7d591a0..af387845e 100644
--- a/docs/public-api/crawlee-utils.api.md
+++ b/docs/public-api/crawlee-utils.api.md
@@ -4,18 +4,14 @@
```ts
-import { Awaitable } from '@crawlee/types';
import type { BaseHttpClient } from '@crawlee/types';
import { Cheerio } from 'cheerio';
import { CheerioAPI } from 'cheerio';
-import { Constructor } from '@crawlee/types';
import type { CrawleeLogger } from '@crawlee/types';
-import { Dictionary } from '@crawlee/types';
+import type { Dictionary } from '@crawlee/types';
import { Element as Element_2 } from 'domhandler';
import type { SearchParams } from '@crawlee/types';
-export { Awaitable }
-
export { Cheerio }
export { CheerioAPI }
@@ -26,10 +22,6 @@ export type CheerioRoot = CheerioAPI;
// @public (undocumented)
export const CLOUDFLARE_RETRY_CSS_SELECTORS: string[];
-export { Constructor }
-
-export { Dictionary }
-
// @public
const DISCORD_REGEX: RegExp;
diff --git a/docs/upgrading/upgrading_v4.md b/docs/upgrading/upgrading_v4.md
index 7463b4c30..09dbef000 100644
--- a/docs/upgrading/upgrading_v4.md
+++ b/docs/upgrading/upgrading_v4.md
@@ -452,6 +452,10 @@ In v3, we introduced a new way to detect available resources for the crawler, av
As part of this change, the low-level resource- and environment-detection helpers exported from `@crawlee/utils` were **removed**: `getMemoryInfo()` (and the `MemoryInfo` interface), `isContainerized()`, `isDocker()`, `isLambda()`, and `getCgroupsVersion()`. These backed the old detection path and are no longer part of the public API. Resource detection is now handled internally by the crawler's autoscaling; if you called any of these directly, read the equivalent values from the OS (`node:os`) or the relevant cgroup files yourself.
+## `@crawlee/types` symbols are no longer re-exported
+
+The general-purpose utility types owned by `@crawlee/types` are no longer re-exported from other packages, so `Dictionary`, `Awaitable`, `Constructor`, `Cookie`, `QueueOperationInfo` and `AllowedHttpMethods` are no longer available from `@crawlee/core` (nor, in turn, from `@crawlee/basic` and the `crawlee` meta-package). Add `@crawlee/types` to your dependencies and import them from there — most of the package's types (`ISession`, `ProxyInfo`, `RequestSchema`, …) already required this. The interfaces you implement against — `StorageBackend`, `StorageIdentifier` and `IBrowserPool` / `NewPageOptions` — stay reachable from `@crawlee/core` and `@crawlee/browser-pool` respectively.
+
## Removed and relocated `@crawlee/utils` exports
Besides the resource-detection helpers above, several other `@crawlee/utils` exports were removed or moved:
diff --git a/packages/browser-crawler/src/internals/browser-crawler.ts b/packages/browser-crawler/src/internals/browser-crawler.ts
index 5e65013e3..10831c08b 100644
--- a/packages/browser-crawler/src/internals/browser-crawler.ts
+++ b/packages/browser-crawler/src/internals/browser-crawler.ts
@@ -1,10 +1,8 @@
import type {
- Awaitable,
BasicCrawlerOptions,
BasicCrawlingContext,
ContextMiddleware,
CrawlingContext,
- Dictionary,
EnqueueLinksOptions,
ErrorHandler,
GetUserDataFromRequest,
@@ -42,7 +40,14 @@ import type {
LaunchContext,
} from '@crawlee/browser-pool';
import { BrowserPool, RemoteBrowserPool } from '@crawlee/browser-pool';
-import type { BatchAddRequestsResult, Cookie as CookieObject, IBrowserPool, ISession } from '@crawlee/types';
+import type {
+ Awaitable,
+ BatchAddRequestsResult,
+ Cookie as CookieObject,
+ Dictionary,
+ IBrowserPool,
+ ISession,
+} from '@crawlee/types';
import type { RobotsTxtFile } from '@crawlee/utils';
import { CLOUDFLARE_RETRY_CSS_SELECTORS, RETRY_CSS_SELECTORS, sleep } from '@crawlee/utils';
import ow from 'ow';
diff --git a/packages/browser-crawler/src/internals/browser-launcher.ts b/packages/browser-crawler/src/internals/browser-launcher.ts
index 876c802a6..824d9f02c 100644
--- a/packages/browser-crawler/src/internals/browser-launcher.ts
+++ b/packages/browser-crawler/src/internals/browser-launcher.ts
@@ -4,7 +4,7 @@ import os from 'node:os';
import { Configuration } from '@crawlee/basic';
import type { BrowserPlugin, BrowserPluginOptions } from '@crawlee/browser-pool';
-import type { Constructor, Dictionary } from '@crawlee/utils';
+import type { Constructor, Dictionary } from '@crawlee/types';
import ow from 'ow';
const DEFAULT_VIEWPORT = {
diff --git a/packages/core/src/crawlers/crawler_commons.ts b/packages/core/src/crawlers/crawler_commons.ts
index 45e7875fd..70fa454a7 100644
--- a/packages/core/src/crawlers/crawler_commons.ts
+++ b/packages/core/src/crawlers/crawler_commons.ts
@@ -5,10 +5,10 @@ import type { Configuration } from '../configuration.js';
import type { EnqueueLinksOptions } from '../enqueue_links/enqueue_links.js';
import type { CrawleeLogger } from '../log.js';
import type { Request, RequestOptions, Source } from '../request.js';
+import type { StorageIdentifier } from '../storages/storage_instance_manager.js';
import type { Dataset } from '../storages/dataset.js';
import { KeyValueStore, type RecordOptions } from '../storages/key_value_store.js';
import type { RequestQueueOperationOptions } from '../storages/request_queue.js';
-import type { StorageIdentifier } from '../storages/storage_instance_manager.js';
/** @internal */
export type IsAny<T> = 0 extends 1 & T ? true : false;
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index e1cc54c27..a80450382 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -19,4 +19,4 @@ export * from './validators.js';
export * from './cookie_utils.js';
export * from './recoverable_state.js';
export { PseudoUrl } from '@apify/pseudo_url';
-export type { Dictionary, Awaitable, Constructor, StorageBackend, Cookie, QueueOperationInfo } from '@crawlee/types';
+export type { StorageBackend } from '@crawlee/types';
diff --git a/packages/core/src/request.ts b/packages/core/src/request.ts
index d781f84c2..53620fe67 100644
--- a/packages/core/src/request.ts
+++ b/packages/core/src/request.ts
@@ -2,7 +2,7 @@ import type { BinaryLike } from 'node:crypto';
import crypto from 'node:crypto';
import util from 'node:util';
-import type { Dictionary } from '@crawlee/types';
+import type { AllowedHttpMethods, Dictionary } from '@crawlee/types';
import type { BasePredicate } from 'ow';
import ow from 'ow';
@@ -11,7 +11,6 @@ import { cryptoRandomObjectId, normalizeUrl } from '@apify/utilities';
import type { EnqueueLinksOptions } from './enqueue_links/enqueue_links.js';
import type { SkippedRequestReason } from './enqueue_links/shared.js';
import { serviceLocator } from './service_locator.js';
-import type { AllowedHttpMethods } from './typedefs.js';
import { keys } from './typedefs.js';
// new properties on the Request object breaks serialization
diff --git a/packages/core/src/router.ts b/packages/core/src/router.ts
index 73f5d78aa..23d0ab399 100644
--- a/packages/core/src/router.ts
+++ b/packages/core/src/router.ts
@@ -1,4 +1,4 @@
-import type { Dictionary } from '@crawlee/types';
+import type { Awaitable, Dictionary } from '@crawlee/types';
import type { StandardSchemaV1 } from '@standard-schema/spec';
import type {
@@ -10,7 +10,6 @@ import type {
} from './crawlers/crawler_commons.js';
import { MissingRouteError, RequestValidationError } from './errors.js';
import type { Request } from './request.js';
-import type { Awaitable } from './typedefs.js';
/**
* The key of the default route — the fallback handler registered via {@apilink Router.addDefaultHandler}.
diff --git a/packages/core/src/storages/access_checking.ts b/packages/core/src/storages/access_checking.ts
index 3ca0ff52b..016dee6fb 100644
--- a/packages/core/src/storages/access_checking.ts
+++ b/packages/core/src/storages/access_checking.ts
@@ -1,6 +1,6 @@
import { AsyncLocalStorage } from 'node:async_hooks';
-import type { Awaitable } from '../typedefs.js';
+import type { Awaitable } from '@crawlee/types';
import { tryCancel } from '@apify/timeout';
const storage = new AsyncLocalStorage<{ checkFunction: () => void }>();
diff --git a/packages/core/src/storages/dataset.ts b/packages/core/src/storages/dataset.ts
index 784def68b..5c40668db 100644
--- a/packages/core/src/storages/dataset.ts
+++ b/packages/core/src/storages/dataset.ts
@@ -1,17 +1,16 @@
-import type { DatasetBackend, DatasetInfo, Dictionary, PaginatedList } from '@crawlee/types';
+import type { Awaitable, DatasetBackend, DatasetInfo, Dictionary, PaginatedList } from '@crawlee/types';
import { stringify } from 'csv-stringify/sync';
import ow from 'ow';
import { Configuration } from '../configuration.js';
import type { CrawleeLogger } from '../log.js';
import { serviceLocator } from '../service_locator.js';
-import type { Awaitable } from '../typedefs.js';
import { checkStorageAccess } from './access_checking.js';
import { KeyValueStore } from './key_value_store.js';
import type { DatasetStats } from './storage_stats.js';
import { StorageStatsTracker } from './storage_stats.js';
-import type { StorageIdentifier } from './storage_instance_manager.js';
import type { StorageOpenOptions } from './utils.js';
+import type { StorageIdentifier } from './storage_instance_manager.js';
import { resolveStorageIdentifier } from './storage_instance_manager.js';
import { createDualIterable, purgeDefaultStorages } from './utils.js';
diff --git a/packages/core/src/storages/key_value_store.ts b/packages/core/src/storages/key_value_store.ts
index b4d396099..8428033aa 100644
--- a/packages/core/src/storages/key_value_store.ts
+++ b/packages/core/src/storages/key_value_store.ts
@@ -1,17 +1,22 @@
-import type { Dictionary, KeyValueStoreBackend, KeyValueStoreInfo, KeyValueStoreItemData } from '@crawlee/types';
+import type {
+ Awaitable,
+ Dictionary,
+ KeyValueStoreBackend,
+ KeyValueStoreInfo,
+ KeyValueStoreItemData,
+} from '@crawlee/types';
import ow, { ArgumentError } from 'ow';
import { KEY_VALUE_STORE_KEY_REGEX } from '@apify/consts';
import { Configuration } from '../configuration.js';
import { serviceLocator } from '../service_locator.js';
-import type { Awaitable } from '../typedefs.js';
import { checkStorageAccess } from './access_checking.js';
import { parseValue, serializeValue } from './key_value_store_codec.js';
import type { KeyValueStoreStats } from './storage_stats.js';
import { StorageStatsTracker } from './storage_stats.js';
-import type { StorageIdentifier } from './storage_instance_manager.js';
import type { StorageOpenOptions } from './utils.js';
+import type { StorageIdentifier } from './storage_instance_manager.js';
import { resolveStorageIdentifier } from './storage_instance_manager.js';
import { createDualIterable, purgeDefaultStorages } from './utils.js';
import { isBuffer, isStream } from '@crawlee/utils';
diff --git a/packages/core/src/storages/request_queue.ts b/packages/core/src/storages/request_queue.ts
index 4674eb018..645749eb7 100644
--- a/packages/core/src/storages/request_queue.ts
+++ b/packages/core/src/storages/request_queue.ts
@@ -3,6 +3,7 @@ import { inspect } from 'node:util';
import type {
BaseHttpClient,
BatchAddRequestsResult,
+ Constructor,
Dictionary,
ProcessedRequest,
QueueOperationInfo,
@@ -24,7 +25,6 @@ import { LruCache } from '@apify/datastructures';
import { Configuration } from '../configuration.js';
import { getObjectType } from '../debug.js';
-import type { Constructor } from '../typedefs.js';
import type { EventManager } from '../events/event_manager.js';
import { EventType } from '../events/event_manager.js';
import type { CrawleeLogger } from '../log.js';
diff --git a/packages/core/src/storages/storage_instance_manager.ts b/packages/core/src/storages/storage_instance_manager.ts
index e79221614..1af5cbab0 100644
--- a/packages/core/src/storages/storage_instance_manager.ts
+++ b/packages/core/src/storages/storage_instance_manager.ts
@@ -1,15 +1,14 @@
import type {
+ Constructor,
DatasetBackend,
KeyValueStoreBackend,
RequestQueueBackend,
StorageBackend,
StorageIdentifier,
} from '@crawlee/types';
-import { AsyncQueue } from '@sapphire/async-queue';
-
-import type { Constructor } from '../typedefs.js';
export type { StorageIdentifier } from '@crawlee/types';
+import { AsyncQueue } from '@sapphire/async-queue';
/**
* Matches an `IStorage` – a storage "frontend" (Dataset, KeyValueStore, RequestQueue).
diff --git a/packages/core/src/typedefs.ts b/packages/core/src/typedefs.ts
index 0d6b811dd..e79602e4e 100644
--- a/packages/core/src/typedefs.ts
+++ b/packages/core/src/typedefs.ts
@@ -1,9 +1,3 @@
-/** @ignore */
-export type Constructor<T = unknown> = new (...args: any[]) => T;
-
-/** @ignore */
-export type Awaitable<T> = T | PromiseLike<T>;
-
/** @ignore */
export function entries<T extends {}>(obj: T) {
return Object.entries(obj) as [keyof T, T[keyof T]][];
@@ -13,5 +7,3 @@ export function entries<T extends {}>(obj: T) {
export function keys<T extends {}>(obj: T) {
return Object.keys(obj) as (keyof T)[];
}
-
-export type { AllowedHttpMethods } from '@crawlee/types';
diff --git a/packages/playwright-crawler/src/internals/utils/playwright-utils.ts b/packages/playwright-crawler/src/internals/utils/playwright-utils.ts
index 589626b4a..c2137480f 100644
--- a/packages/playwright-crawler/src/internals/utils/playwright-utils.ts
+++ b/packages/playwright-crawler/src/internals/utils/playwright-utils.ts
@@ -23,8 +23,8 @@ import { createRequire } from 'node:module';
import vm from 'node:vm';
import { Configuration, KeyValueStore, type Request, serviceLocator, SessionError, validators } from '@crawlee/browser';
-import type { BatchAddRequestsResult } from '@crawlee/types';
-import { type CheerioRoot, type Dictionary, expandShadowRoots, sleep } from '@crawlee/utils';
+import type { BatchAddRequestsResult, Dictionary } from '@crawlee/types';
+import { type CheerioRoot, expandShadowRoots, sleep } from '@crawlee/utils';
import * as cheerio from 'cheerio';
import ow from 'ow';
import type { Download, Page, Response, Route } from 'playwright';
diff --git a/packages/puppeteer-crawler/src/internals/utils/puppeteer_request_interception.ts b/packages/puppeteer-crawler/src/internals/utils/puppeteer_request_interception.ts
index edb720435..37b6ae899 100644
--- a/packages/puppeteer-crawler/src/internals/utils/puppeteer_request_interception.ts
+++ b/packages/puppeteer-crawler/src/internals/utils/puppeteer_request_interception.ts
@@ -1,7 +1,7 @@
import { EventEmitter } from 'node:events';
import { serviceLocator } from '@crawlee/browser';
-import type { Dictionary } from '@crawlee/utils';
+import type { Dictionary } from '@crawlee/types';
import ow from 'ow';
// @ts-ignore This only throws when compiled against puppeteer 25+ (ESM only), we only import types, so its alllll gooooood
import type { HTTPRequest, HTTPRequest as PuppeteerRequest, Page } from 'puppeteer';
diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts
index 164f8b95f..e6129fdff 100644
--- a/packages/utils/src/index.ts
+++ b/packages/utils/src/index.ts
@@ -3,13 +3,8 @@ export * from './internals/cheerio.js';
export * from './internals/extract-urls.js';
export * from './internals/general.js';
export * as social from './internals/social.js';
-export * from './internals/typedefs.js';
export * from './internals/open_graph_parser.js';
export * from './internals/robots.js';
export * from './internals/sitemap.js';
export * from './internals/iterables.js';
-export * from './internals/robots.js';
-export * from './internals/sitemap.js';
export * from './internals/url.js';
-
-export type { Dictionary, Awaitable, Constructor } from '@crawlee/types';
diff --git a/packages/utils/src/internals/typedefs.ts b/packages/utils/src/internals/typedefs.ts
deleted file mode 100644
index e79602e4e..000000000
--- a/packages/utils/src/internals/typedefs.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-/** @ignore */
-export function entries<T extends {}>(obj: T) {
- return Object.entries(obj) as [keyof T, T[keyof T]][];
-}
-
-/** @ignore */
-export function keys<T extends {}>(obj: T) {
- return Object.keys(obj) as (keyof T)[];
-}
diff --git a/test/core/browser_launchers/puppeteer_launcher.test.ts b/test/core/browser_launchers/puppeteer_launcher.test.ts
index b4d5eb0f6..6036f6ac0 100644
--- a/test/core/browser_launchers/puppeteer_launcher.test.ts
+++ b/test/core/browser_launchers/puppeteer_launcher.test.ts
@@ -6,7 +6,7 @@ import path from 'node:path';
import util from 'node:util';
import { BrowserLauncher, launchPuppeteer } from '@crawlee/puppeteer';
-import type { Dictionary } from '@crawlee/utils';
+import type { Dictionary } from '@crawlee/types';
// @ts-expect-error no types
import basicAuthParser from 'basic-auth-parser';
// @ts-expect-error no types
diff --git a/test/core/crawlers/adaptive_playwright_crawler.test.ts b/test/core/crawlers/adaptive_playwright_crawler.test.ts
index 1a71da540..b7ea362a9 100644
--- a/test/core/crawlers/adaptive_playwright_crawler.test.ts
+++ b/test/core/crawlers/adaptive_playwright_crawler.test.ts
@@ -6,7 +6,6 @@ import {
type CrawleeLogger,
type CrawleeLoggerOptions,
Dataset,
- type Dictionary,
EventType,
KeyValueStore,
MemoryStorageBackend,
@@ -27,6 +26,7 @@ import {
RequestList,
RequestValidationError,
} from '@crawlee/playwright';
+import type { Dictionary } from '@crawlee/types';
import { sleep } from 'crawlee';
import express from 'express';
import { z } from 'zod';
diff --git a/test/core/crawlers/basic_crawler.test.ts b/test/core/crawlers/basic_crawler.test.ts
index c8da38bdb..11391ca17 100644
--- a/test/core/crawlers/basic_crawler.test.ts
+++ b/test/core/crawlers/basic_crawler.test.ts
@@ -23,8 +23,7 @@ import {
SessionPool,
} from '@crawlee/basic';
import { ConcurrencySystem, Dataset, MemoryStorageBackend, RequestState, SessionPool, Statistics } from '@crawlee/core';
-import type { ISession, ProxyInfo } from '@crawlee/types';
-import type { Dictionary } from '@crawlee/utils';
+import type { Dictionary, ISession, ProxyInfo } from '@crawlee/types';
import { RobotsTxtFile, sleep } from '@crawlee/utils';
import express from 'express';
import type { SetRequired } from 'type-fest';
diff --git a/test/core/crawlers/cheerio_crawler.test.ts b/test/core/crawlers/cheerio_crawler.test.ts
index 56df452b7..60fadd34e 100644
--- a/test/core/crawlers/cheerio_crawler.test.ts
+++ b/test/core/crawlers/cheerio_crawler.test.ts
@@ -19,8 +19,7 @@ import {
SessionPool,
} from '@crawlee/core';
import { ImpitHttpClient } from '@crawlee/impit-client';
-import type { ISession, ProxyInfo } from '@crawlee/types';
-import type { Dictionary } from '@crawlee/utils';
+import type { Dictionary, ISession, ProxyInfo } from '@crawlee/types';
import { sleep } from '@crawlee/utils';
import iconv from 'iconv-lite';
import { CookieJar } from 'tough-cookie';
diff --git a/test/core/crawlers/error_handler_types.test.ts b/test/core/crawlers/error_handler_types.test.ts
index 5ddc9a191..09357f742 100644
--- a/test/core/crawlers/error_handler_types.test.ts
+++ b/test/core/crawlers/error_handler_types.test.ts
@@ -3,7 +3,7 @@ import type { BrowserCrawlerOptions, BrowserCrawlingContext } from '@crawlee/bro
import type { CheerioCrawlerOptions, CheerioErrorHandler, CheerioRequestHandler } from '@crawlee/cheerio';
import type { HttpCrawlerOptions, HttpCrawlingContext, HttpErrorHandler } from '@crawlee/http';
import type { PlaywrightCrawlerOptions, PlaywrightCrawlingContext } from '@crawlee/playwright';
-import type { Dictionary } from '@crawlee/utils';
+import type { Dictionary } from '@crawlee/types';
/**
* Type-level regression test for https://github.com/apify/crawlee/issues/3424.
diff --git a/test/core/crawlers/statistics.test.ts b/test/core/crawlers/statistics.test.ts
index 10354c637..924b5a092 100644
--- a/test/core/crawlers/statistics.test.ts
+++ b/test/core/crawlers/statistics.test.ts
@@ -1,5 +1,5 @@
import { Configuration, EventType, MemoryStorageBackend, serviceLocator, Statistics } from '@crawlee/core';
-import type { Dictionary } from '@crawlee/utils';
+import type { Dictionary } from '@crawlee/types';
describe('Statistics', () => {
const getPerMinute = (jobCount: number, totalTickMillis: number) => {
diff --git a/test/core/puppeteer_utils.test.ts b/test/core/puppeteer_utils.test.ts
index 0b77b49a9..f0b21c2ac 100644
--- a/test/core/puppeteer_utils.test.ts
+++ b/test/core/puppeteer_utils.test.ts
@@ -3,7 +3,7 @@ import path from 'node:path';
import { MemoryStorageBackend, serviceLocator } from '@crawlee/core';
import { KeyValueStore, launchPuppeteer, puppeteerUtils, Request } from '@crawlee/puppeteer';
-import type { Dictionary } from '@crawlee/utils';
+import type { Dictionary } from '@crawlee/types';
// @ts-ignore This only throws when compiled against puppeteer 25+ (ESM only), we only import types, so its alllll gooooood
import type { Browser, Page, ResponseForRequest } from 'puppeteer';
import { runExampleComServer } from '../shared/_helper.js';
diff --git a/test/core/session_pool/session.test.ts b/test/core/session_pool/session.test.ts
index 7f40a7a9f..bd93eb294 100644
--- a/test/core/session_pool/session.test.ts
+++ b/test/core/session_pool/session.test.ts
@@ -1,5 +1,7 @@
import { Session } from '@crawlee/core';
-import { entries, sleep } from '@crawlee/utils';
+import { sleep } from '@crawlee/utils';
+
+import { entries } from '../../shared/typedefs.js';
describe('Session - testing session behaviour', () => {
let session: Session;
diff --git a/test/core/session_pool/session_pool.test.ts b/test/core/session_pool/session_pool.test.ts
index c4022e6de..2c65b9181 100644
--- a/test/core/session_pool/session_pool.test.ts
+++ b/test/core/session_pool/session_pool.test.ts
@@ -7,7 +7,8 @@ import {
Session,
SessionPool,
} from '@crawlee/core';
-import { entries } from '@crawlee/utils';
+
+import { entries } from '../../shared/typedefs.js';
describe('SessionPool - testing session pool', () => {
let sessionPool: SessionPool;
diff --git a/test/core/storages/dataset.test.ts b/test/core/storages/dataset.test.ts
index 4225c2c76..1cda55522 100644
--- a/test/core/storages/dataset.test.ts
+++ b/test/core/storages/dataset.test.ts
@@ -1,5 +1,5 @@
import { assertJsonSerializable, Dataset, KeyValueStore, MemoryStorageBackend, serviceLocator } from '@crawlee/core';
-import type { Dictionary } from '@crawlee/utils';
+import type { Dictionary } from '@crawlee/types';
import { MAX_PAYLOAD_SIZE_BYTES } from '@apify/consts';
diff --git a/test/core/storages/key_value_store.test.ts b/test/core/storages/key_value_store.test.ts
index fe0896d10..f43bdbfe0 100644
--- a/test/core/storages/key_value_store.test.ts
+++ b/test/core/storages/key_value_store.test.ts
@@ -1,7 +1,7 @@
import { PassThrough } from 'node:stream';
import { KeyValueStore, MemoryStorageBackend, serviceLocator } from '@crawlee/core';
-import type { Dictionary } from '@crawlee/utils';
+import type { Dictionary } from '@crawlee/types';
import { toBuffer } from '@crawlee/utils';
beforeEach(async () => {
diff --git a/test/core/storages/utils.test.ts b/test/core/storages/utils.test.ts
index a9bba6ece..eab19ddea 100644
--- a/test/core/storages/utils.test.ts
+++ b/test/core/storages/utils.test.ts
@@ -1,6 +1,5 @@
-import type { Dictionary } from '@crawlee/core';
+import type { Dictionary, StorageBackend } from '@crawlee/types';
import { Configuration, KeyValueStore, MemoryStorageBackend, purgeDefaultStorages, serviceLocator, useState } from '@crawlee/core';
-import type { StorageBackend } from '@crawlee/types';
describe('useState', () => {
beforeEach(async () => {
diff --git a/test/shared/_helper.ts b/test/shared/_helper.ts
index 13afd60d5..24a40279a 100644
--- a/test/shared/_helper.ts
+++ b/test/shared/_helper.ts
@@ -4,11 +4,12 @@ import path from 'node:path';
import { setTimeout } from 'node:timers/promises';
import bodyParser from 'body-parser';
-import { entries } from 'crawlee';
import type { Application } from 'express';
import express from 'express';
import iconv from 'iconv-lite';
+import { entries } from './typedefs.js';
+
export const startExpressAppPromise = async (app: Application, port: number) => {
return new Promise<Server>((resolve) => {
const server = app.listen(port, () => resolve(server));
diff --git a/test/shared/typedefs.ts b/test/shared/typedefs.ts
new file mode 100644
index 000000000..8bf8258de
--- /dev/null
+++ b/test/shared/typedefs.ts
@@ -0,0 +1,3 @@
+export function entries<T extends {}>(obj: T) {
+ return Object.entries(obj) as [keyof T, T[keyof T]][];
+}