technological-jadeT
Apify & Crawleeโ€ข2y agoโ€ข
10 replies
technological-jade

How to access Apify.utils with ES modules?

The docs all have code like the following to use
enqueueLinks
where you can target a specific request queue.

const Apify = require('apify')
Apify.utils.enqueueLinks({ requestQueue: myQueue })


However this won't work within an ES module project (which is what is setup when you use the actor starter templates!). I've tried
import {utils} from 'apify'
but there does not appear to be a named export like that.

How do I access this API? All the docs seem to be referencing CJS which should probably be updated if the official templates are not using this. I looked at the type for the requestHandler contextual
enqueueLinks
and it appears to omit the
requestQueue
property so cannot override there.
Was this page helpful?