BinaryBard
CCConvex Community
ā¢Created by BinaryBard on 4/21/2025 in #support-community
Persistent Node Built-in Resolution Errors (util, zlib, etc.) with apify-client Despite "use node";
Hey everyone,
I'm running into a persistent issue trying to use apify-client (^2.12.2) within a Convex (^1.23.0) action on Windows 11. Even with "use node"; correctly placed, the convex dev build consistently fails with esbuild errors like:
X [ERROR] Could not resolve "util"
X [ERROR] Could not resolve "zlib"
X [ERROR] Could not resolve "events"
X [ERROR] Could not resolve "os"
ā It looks like you are using Node APIs from a file without the "use node" directive.
These errors point to apify-client and @apify/log dependencies.
I've tried pretty much everything I can think of:
Confirmed "use node"; is the very first line in the action file (convex/googleMaps/actions.ts) and any local files it imports that might need it (convex/googleMaps/utils.ts).
Verified no non-Node files import the Node files.
Added apify-client, @apify/log, util, zlib, events, os to experimentalExternalPackages in convex.json.
Added nodeModules: true to convex.json.
Did a full node_modules and package-lock.json deletion and npm install.
Restarted convex dev countless times.
Despite all this, the errors remain identical. It seems like the bundler isn't recognizing the Node platform context for this specific package, even with all the flags set.
Has anyone else run into similar stubborn resolution issues with packages requiring Node built-ins, specifically apify-client or similar, on recent Convex versions? Any suggestions beyond the steps already tried would be greatly appreciated!
Thanks!
3 replies