vercel / next.js

The React Framework
https://nextjs.org
MIT License
123.74k stars 26.39k forks source link

Redis cache handler example incorrect #66812

Closed papertiger12 closed 2 weeks ago

papertiger12 commented 1 month ago

Verify canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:55:06 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6020
  Available memory (MB): 32768
  Available CPU cores: 12
Binaries:
  Node: 18.17.0
  npm: 9.6.7
  Yarn: 1.22.19
  pnpm: 8.11.0
Relevant Packages:
  next: 14.2.3 // There is a newer version (14.2.4) available, upgrade recommended! 
  eslint-config-next: 14.2.3
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.4.5
Next.js Config:
  output: standalone
 ⚠ There is a newer version (14.2.4) available, upgrade recommended! 
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

Which example does this report relate to?

cache-handler-redis

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

The Cache handler return value is not compatible with the @neshca/cache-handler package. Trying to run next build with the current logic throws a TypeError: Cannot read properties of undefined (reading 'filter')

Expected Behavior

The return value of the CacheHandler should be updated to the following (or similar):

  /** @type {import("@neshca/cache-handler").CacheHandlerConfig} */
  return {
    handlers: [redisCache, localCache],
  };

To Reproduce

mauroaccornero commented 1 month ago

I've added a small PR for this if you have any feedback let me know.

delbaoliveira commented 2 weeks ago

Hey @mauroaccornero, thank you for taking the time to fix the build 🙏🏼

github-actions[bot] commented 3 days ago

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.