fix: CI build errors + simplify cache handler and data cache

- Remove `export const dynamic` from 4 routes (incompatible with cacheComponents)
- Static import for redis-handler (Turbopack can't resolve relative dynamic imports)
- Simplify redis-handler: Buffer.concat, NonNullable, single connect promise
- Inline single-use helpers in integration-data-cache
- Non-greedy SVG regex to prevent ReDoS
- Inline getDevelopmentServiceAliases in next.config
- Remove restating comments
This commit is contained in:
Thomas Camlong committed 2026-08-08 00:19:27 +02:00
1 parent 6f563640ac
commit 345a4be4b0
12 files changed
+79 -98

No files matched your search

+4 -4
View File
@@ -1,13 +1,13 @@
import type { CacheHandler } from "next/dist/server/lib/cache-handlers/types";
import { RedisCacheHandler } from "./redis-handler";
let handlerPromise: Promise<CacheHandler> | undefined;
const createHandlerAsync = async (): Promise<CacheHandler> => {
const useRedis = process.env.REDIS_HOST || process.env.REDIS_IS_EXTERNAL === "true";
if (useRedis) {
const { RedisCacheHandler } = await import("./redis-handler");
return new RedisCacheHandler();
}
if (useRedis) return new RedisCacheHandler();
const { createDefaultCacheHandler } = await import("next/dist/server/lib/cache-handlers/default");
return createDefaultCacheHandler(32 * 1024 * 1024);
};