{"record":{"id":"15331b030bc6b8c2","repo":"apify/crawlee","slug":"request-options-are-not-valid-the-id-property-m","errorCode":null,"errorMessage":"Request options are not valid, the 'id' property must not be present. Input: ${inspect(opts)}","messagePattern":"Request options are not valid, the 'id' property must not be present\\. Input: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/storages/request_queue.ts","lineNumber":604,"sourceCode":"        parseArgument(requests, iterableSchema);\n\n        const { forefront, waitForAllRequestsToBeAdded, batchSize, waitBetweenBatchesMillis, maxNewRequests } =\n            parseArgument(options, addRequestsBatchedOptionsSchema);\n\n        const addRequest = this.addRequest.bind(this);\n\n        async function* generateRequests() {\n            for await (const opts of requests) {\n                // Validate the input\n                if (typeof opts === 'object' && opts !== null) {\n                    if (opts.url !== undefined && typeof opts.url !== 'string') {\n                        throw new Error(\n                            `Request options are not valid, the 'url' property is not a string. Input: ${inspect(opts)}`,\n                        );\n                    }\n\n                    if (opts.id !== undefined) {\n                        throw new Error(\n                            `Request options are not valid, the 'id' property must not be present. Input: ${inspect(opts)}`,\n                        );\n                    }\n\n                    if (\n                        (opts as any).requestsFromUrl !== undefined &&\n                        typeof (opts as any).requestsFromUrl !== 'string'\n                    ) {\n                        throw new Error(\n                            `Request options are not valid, the 'requestsFromUrl' property is not a string. Input: ${inspect(opts)}`,\n                        );\n                    }\n                }\n\n                if (opts && typeof opts === 'object' && 'requestsFromUrl' in opts) {\n                    // Handle URL lists right away\n                    await addRequest(opts, { forefront });\n                } else {","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/apify/crawlee/blob/dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c/packages/core/src/storages/request_queue.ts#L586-L622","documentation":"In RequestQueue, a request's identity is derived from its url (or uniqueKey); callers must not supply an explicit id. generateRequests() rejects any options object containing a defined id property, since injected ids would collide with the queue's internal id generation and break deduplication/lookup.","triggerScenarios":"Passing { id: '...', url } objects to addRequestsBatched; forwarding Request-like objects (which carry an id) from another queue's output directly into addRequestsBatched; copying stored queue items back into the queue unchanged.","commonSituations":"Re-enqueuing requests fetched from the same or another RequestQueue (their id field is set); persisting and reloading raw queue entries; adapting code from RequestList (which uses uniqueKey, not id) to RequestQueue.","solutions":["Remove the id property before adding: pass { url, ...rest } without id","If re-enqueuing fetched requests, reconstruct from url/uniqueKey or strip id via destructuring","Use uniqueKey (not id) to control deduplication in RequestQueue"],"exampleFix":"// before\nawait queue.addRequestsBatched(fetchedRequests); // items contain id\n// after\nconst clean = fetchedRequests.map(({ id, ...rest }) => rest);\nawait queue.addRequestsBatched(clean);","handlingStrategy":"validation","validationCode":"const withoutIds = requests.map(({ id, ...rest }) => rest);\nawait queue.addRequestsBatched(withoutIds);","typeGuard":"function hasNoId(r) {\n  return !(r && typeof r === 'object' && 'id' in r && r.id !== undefined);\n}","tryCatchPattern":"try {\n  await queue.addRequestsBatched(requests);\n} catch (err) {\n  if (err.message.includes(\"'id' property must not be present\")) {\n    await queue.addRequestsBatched(requests.map(({ id, ...rest }) => rest));\n  } else throw err;\n}","preventionTips":["Never pass queue-fetched Request objects back into addRequestsBatched unchanged","Use uniqueKey for deduplication control, not id","Strip storage-managed fields when re-enqueuing"],"tags":["validation","request-queue","api-misuse"],"backgroundTag":"invalid-input-type","analyzedSha":"dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c","analyzedAt":"2026-08-30T22:22:28.328Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}