next-shared-cache icon indicating copy to clipboard operation
next-shared-cache copied to clipboard

Update to `next`15 / `react`19 causes type errors in the console

Open pepew-le-boss opened this issue 1 year ago • 5 comments

I've updated my next project to the version 15 coming with react version 19.

But now when I build the app and run it, I get 2 different type errors in the console:

  1. [TypeError: Cannot read properties of undefined (reading 'isDynamic')]
  2. [Error: failed to pipe response] { [cause]: [TypeError: readable.pipeTo is not a function] }

I can still build the app, still use the app and still use the cache, basically everything is working fine. But these two errors are spammed in the console every time I navigate or do actions on the website.

Because I pay the log usage once the app is deployed, this bug is major for me.

I'm almost certain the bug come from this library because when I don't use this cache and fallback to the next cache, these errors are not logged anymore.

Environment:

  • OS: Windows
  • Node.js version: 18.18.0
  • @neshca/cache-handler version: 1.9.0
  • next version: 15.1.4

pepew-le-boss avatar Jan 15 '25 15:01 pepew-le-boss

Having the same issue, the only difference is that I get 500 Internal Server errors when navigating to any page on my app.

Using a custom implementation that uses S3 as the data store, with a fallback LRU cache.

Removing all code related to the cache handler in next.config.ts gets rid of the 500s.

Image

Image

ViktorShev avatar Jan 20 '25 21:01 ViktorShev

We've faced with the same issue with @ViktorShev and saw the requirements on npm (not compatible with next 15). Downgrading next version to 14 resolved the issue

Image

benjapadilla1 avatar Jan 21 '25 20:01 benjapadilla1

We have also downgraded to Nextjs 14.2 because @neshca/[email protected] is not compatible with Nextjs 15 or higher

neilhem avatar Feb 06 '25 10:02 neilhem

Any updates on this? I’ve seen there is a pull request, but there hasn’t been an update since February.

https://github.com/caching-tools/next-shared-cache/pull/969

henrikvolmer avatar Mar 17 '25 08:03 henrikvolmer

As it seems this plugin is not actively maintained anymore we created a new improved redis cache handler for next.js 15. It uses redis keyevent notifications to fix this issue. Besides that I implemented a couple of other performance optimizations by eliminating the resource hungry hscan and including some in-memory caching synced via keyspace notification (so it is multi node capable).

You can take a look here: https://github.com/trieb-work/nextjs-turbo-redis-cache

tilman avatar May 26 '25 13:05 tilman