SOLVED: enqueueLinks not working properly
hey, i'm trying to crawl a website, and i use the enqueueLinks() function which is supposedly context-aware.
however, when i call await enqueueLinks() at the bottom of my request handler (i can confirm it is actually IN the request handler), it gives me this error:
anyone have any idea what's going on?
2 Replies
deep-jadeOP•2y ago
UPDATE:
thanks to @shovelandsandbox, i have figured the root of the problem.
when you want to use enqueueLinks() inside a request handler, you have to destructure it, too.
also, make sure that enqueueLinks is not imported!
here's what @shovelandsandbox wrote:
previously, i was running the request handler with just
{ $, request }
destructured.
again, thank you to @shovelandsandbox for helping me solve this, as this will probably help many others who are likely to face this problem.notable-maroon•2y ago