Possible to define a cache-handler.ts file ? #392
-
Hello, I'm using the Cache-Handler package with an ioredis stack. I already have a file where all the logic for connecting to Redis is located. However, I'm unable to reuse this logic in the cache-handler.mjs file because it's a TS file, and Next.js returns an error 'TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts' during my tests. Is there a way to use a .TS file or reuse the Redis connection logic? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Unfortunately, Next.js custom cache API expects a path to a JS file. Internally, they call a constructor without building or transpiling the cache-handler code. So the answer is no 😢 |
Beta Was this translation helpful? Give feedback.
Hey @AlexandreBourdeaudhui!
Unfortunately, Next.js custom cache API expects a path to a JS file. Internally, they call a constructor without building or transpiling the cache-handler code.
So the answer is no 😢