Crawlee specifies that handleAt should be an ISO datetime string, but I have a type validation error with the following code:
const requestQueue = await Actor.openRequestQueue();
const nowISO = new Date().toISOString();
await requestQueue.addRequests(
someData.map((d) => ({
method: 'GET',
uniqueKey: d.url,
url: d.url,
handledAt: nowISO,
state: RequestState.DONE,
})),
);
When running this code inside apify prod environement:
ERROR Request batch insert failed
ApifyApiError: Invalid value provided in requests: requests.0.handledAt must be of type Date(details: type=schema-validation)
clientMethod: RequestQueueClient.batchAddRequests
statusCode: 400
type: schema-validation
attempt: 1
httpMethod: post
path: /v2/request-queues/BMM7W3VSBmYUgGprd/requests/batch
stack:
at makeRequest (/usr/src/app/packages/hearthstone/node_modules/.pnpm/apify-client@2.6.3/node_modules/apify-client/dist/http_client.js:183:30)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestQueueClient._batchAddRequests (/usr/src/app/packages/hearthstone/node_modules/.pnpm/apify-client@2.6.3/node_modules/apify-client/dist/resource_clients/request_queue.js:136:26)
at async RequestQueueClient._batchAddRequestsWithRetries (/usr/src/app/packages/hearthstone/node_modules/.pnpm/apify-client@2.6.3/node_modules/apify-client/dist/resource_clients/request_queue.js:159:34)
Crawlee specifies that
handleAtshould be an ISO datetime string, but I have a type validation error with the following code:When running this code inside apify prod environement: