Support Next 15 - When? #691
Replies: 11 comments 17 replies
-
Hey @yuriyyakym! Thank you for bringing up this topic. I appreciate your contribution and interest in adding support for Next.js 15. I was waiting for the RC 1 of Next.js 15 to continue working on this pull request. I will check if the latest canary of the Next.js is passing tests. Regarding your workaround, it's great that you've found one! |
Beta Was this translation helpful? Give feedback.
-
I've been pulling my hair out thinking there was an issue with my code! So it's simply that there's no support for Next 15 yet. I'm running v15.0.0-canary.190. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@better-salmon RC1 has landed :) https://github.com/vercel/next.js/releases/tag/v15.0.0-rc.1 |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! I’m currently working on supporting Next.js 15. It will take a bit of time, as there are many changes in Next.js, some of which are breaking. I aim to maintain backward compatibility as much as possible. I appreciate your patience during this process! |
Beta Was this translation helpful? Give feedback.
-
Just a quick update! Believe it or not, I somehow managed to catch Covid-19 in 2024. 😆 But I’m all better now and back to work! Made a new PR #846 |
Beta Was this translation helpful? Give feedback.
-
Are there any updates? I noticed there's a Next15 branch in the repository. Can we directly use this branch now to support Next.js 15? Thank you. |
Beta Was this translation helpful? Give feedback.
-
For somebody who running this plugin under redis-strings and still getting 500 can be helpful #846 (comment) |
Beta Was this translation helpful? Give feedback.
-
Hi @better-salmon, I’m starting to worry this plugin might be abandoned. Next.js 15 support is clearly important to many here, and there’s been no update for a while. Could you let us know if this is still being actively worked on? If not, it would be great to know so the community can explore alternatives or step in. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, I also need support for Next 15. I use this one, and all my tests pass. Has anyone else tested this? → fortedigital/nextjs-cache-handler If you’re interested, I can share my cache-handler.mjs file with the implementation of this dependency. Thx |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! Does anyone have any information about when this package is planned to be updated to support Next 15.X? 😮 |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, I'm currently working with Next.js 15.3.1 and have integrated the following dependencies: "redis": "^4.7.0" "@neshca/cache-handler": "^1.9.0" With the configuration below, I can successfully set and get cache values. However, I'm encountering issues with cache revalidation. /* eslint-disable @typescript-eslint/no-require-imports */
const { CacheHandler } = require("@neshca/cache-handler");
const createClusterHandler =
require("@neshca/cache-handler/experimental-redis-cluster").default;
const { createCluster } = require("redis");
const { PHASE_PRODUCTION_BUILD } = require("next/constants");
/* from https://caching-tools.github.io/next-shared-cache/redis */
CacheHandler.onCreation(async () => {
let cluster;
// Use redis cluster during build could cause issue https://github.com/caching-tools/next-shared-cache/issues/284#issuecomment-1919145094
if (PHASE_PRODUCTION_BUILD !== process.env.NEXT_PHASE) {
try {
// Use REDIS_CLUSTER_URLS env var (comma-separated URLs) for cluster, else REDIS_URL for single node, else default to localhost:6379
const clusterUrls = process.env.REDIS_CLUSTER_URLS
? process.env.REDIS_CLUSTER_URLS.split(",").map((url) => {
return { url: url.trim() };
})
: null;
if (clusterUrls && clusterUrls.length > 1) {
// Use cluster mode for multiple Redis nodes
console.info("Using Redis cluster mode with multiple nodes");
cluster = createCluster({
rootNodes: clusterUrls,
});
// Redis won't work without error handling.
cluster.on("error", (e) => {
console.error("Redis cluster error:", e);
throw e;
});
}
// Error handlers are now set up within the connection creation blocks
} catch (error) {
console.warn("Failed to create Redis cluster:", error);
}
}
// Connect to Redis
if (cluster) {
try {
console.info("Connecting Redis cluster...");
// Wait for the cluster to connect.
// Caveat: This will block the server from starting until the cluster is connected.
// And there is no timeout. Make your own timeout if needed.
await cluster.connect();
console.info("Redis cluster connected.");
} catch (error) {
console.warn("Failed to connect Redis cluster:", error);
console.warn("Disconnecting the Redis cluster...");
// Try to disconnect the cluster to stop it from reconnecting.
cluster
.disconnect()
.then(() => {
console.info("Redis cluster disconnected.");
})
.catch(() => {
console.warn(
"Failed to quit the Redis cluster after failing to connect."
);
});
// Set cluster to null so we don't try to use it
cluster = null;
}
}
/** @type {import("@neshca/cache-handler").Handler | null} */
let redisHandler = null;
if (cluster) {
redisHandler = createClusterHandler({
keyPrefix: "my-app-cache:",
sharedTagsKey: "_sharedTags_",
timeoutMs: 1000,
cluster,
});
}
return {
handlers: [redisHandler],
};
});
module.exports = CacheHandler; I'm seeking a temporary workaround for cache revalidation until version 2.0.0 of @neshca/cache-handler is released. Any guidance or suggestions would be greatly appreciated. Thank you! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey!
Is there a plan to release Next 15 support?
I see there is an open PR.
The code in the PR looks good, though not passing some tests.
We're using Next 15, so supporting rsc data was crucial for us.
For now I had to monkey-patch cacheHandler like this (inspired by the PR):
It would be nice if you release the version with Next 15 support under some rc/beta tag.
Beta Was this translation helpful? Give feedback.
All reactions