I have used this code.
which is provided onsite for example.
// Import the JavaScript SDK into your project
import { Actor } from 'apify';
await Actor.init();
// ...
const queue = await Actor.openRequestQueue();
// Enqueue requests
await queue.addRequests([{ url: 'http://example.com/aaa' }]);
await queue.addRequests(['http://example.com/foo', 'http://example.com/bar'], {
forefront: true,
});
// Get the next request from queue
const request1 = await queue.fetchNextRequest();
const request2 = await queue.fetchNextRequest();
// Get a specific request
const specificRequest = await queue.getRequest('shi6Nh3bfs3');
// Reclaim a failed request back to the queue
// and process it again
await queue.reclaimRequest(request2);
// Remove a queue
await queue.drop();
// ...
await Actor.exit();
I am getting this error.