How to add custom unenv polyfills for cloudflare-module
I struggle using
@aws-sdk/client-s3
with cloudflare-module
preset.
I keep getting the error Error: [unenv] fs.readFile is not implemented yet!
at runtime, when I try to upload to/download from an S3 bucket or pre-sign URLs.
Does anyone have similar issues when deploying to Cloudflare? Or now how I can add custom polyfills (unenv/node/fs
in my case) on top of the default ones?
I already tried the following:
* Switching from cloudflare-module
to cloudflare-pages
following the TanStack Start docs for React (I'm using SolidJs)
* Aliasing fs
and node:fs
following the Cloudflare docs:
* Aliasing fs
and node:fs
via resolve.alias
in Vite:
Unfortunately, nothing worked so far, always getting the same error at runtime.0 Replies