muxinc / blurhash

Using woltapp/blurhash to make nice placeholders for Mux videos. Works nicely with Mux Player.
https://mux-blurhash-react.vercel.app
MIT License
14 stars 3 forks source link

Failed to set fetch cache running on Next.js #14

Open jamesvclements opened 10 months ago

jamesvclements commented 10 months ago

I'm getting the following error running this on next@14.0.1:

Failed to set fetch cache https://image.mux.com/DfBLW4SB01VV6ZRT2pgy9z2q016o44p7UmZo00enfqZ6w00/thumbnail.png Error: fetch for over 2MB of data can not be cached
    at IncrementalCache.set

I'm assuming this is happening because muxBlurHash(... is using fetch, and fetch is overwritten by Next to enable caching. Could we adjust the fetch call in this package to disable caching? I tried wrapping my await muxBlurHash( call in a try catch block but that doesn't seem to suppress the error.

heff commented 10 months ago

Thanks for letting us know, @jamesvclements! We'll look into it.

I think I've heard that Next's wrapping of fetch has bitten us before.

heff commented 10 months ago

One suggestion that came up was to use undici, at least for now...