ioredis icon indicating copy to clipboard operation
ioredis copied to clipboard

Unable to use Edge Runtime with ioredis

Open NotDarkn opened this issue 1 year ago • 4 comments

(simplified log)

01:11:23.508 | â–²  â–² Next.js 14.2.5
01:11:23.508 | â–²
01:11:23.509 | â–²  Linting and checking validity of types ...
01:11:28.874 | â–²  Creating an optimized production build ...
01:11:38.609 | â–²  Failed to compile
01:11:38.609 | â–²  ./node_modules/.pnpm/[email protected]/node_modules/ioredis/built/ScanStream.js:3:1
01:11:38.609 | â–²  Module not found: Can't resolve 'stream'
01:11:38.610 | â–²  ./node_modules/.pnpm/[email protected]/node_modules/ioredis/built/Script.js:3:1
01:11:38.610 | â–²  Module not found: Can't resolve 'crypto'
01:11:38.612 | â–²  ./node_modules/.pnpm/[email protected]/node_modules/ioredis/built/cluster/ClusterOptions.js:4:1
01:11:38.612 | â–²  Module not found: Can't resolve 'dns'
01:11:38.614 | â–²  ./node_modules/.pnpm/[email protected]/node_modules/ioredis/built/cluster/util.js:5:1
01:11:38.614 | â–²  Module not found: Can't resolve 'net'
01:11:38.616 | â–²  ./node_modules/.pnpm/[email protected]/node_modules/ioredis/built/connectors/SentinelConnector/index.js:4:1
01:11:38.617 | â–²  Module not found: Can't resolve 'net'

Upon adding the Edge Runtime to the code that I'm using, it breaks ioredis as it has modules that do not support the Edge Runtime, and since the code I'm using requires the Edge Runtime to work with the hosting provider I'm using (Cloudflare Pages), there isn't much that I can do. Plus, this isn't my code, so I can't change anything.

NotDarkn avatar Aug 14 '24 23:08 NotDarkn

Did anyone resolve the issue in any way?

Denyllon avatar Jan 21 '25 14:01 Denyllon

Did anyone resolve the issue in any way?

As far as I can tell, probably not. The project I was using was OneDrive Vercel Index, however I ended up switching to OneDrive Cloudflare Index instead as then I didn't have to transfer all of the Vercel stuff to Cloudflare myself. Anyways, maybe this has been fixed since then though? But I haven't taken a look.

NotDarkn avatar Jan 21 '25 15:01 NotDarkn

Im still facing the same problem here with [email protected] and [email protected]

CSAT1999 avatar Jan 27 '25 09:01 CSAT1999

facing same error

napstar-420 avatar Jul 09 '25 00:07 napstar-420