Skip to content

Commit bfc9adb

Browse files
authored
Fixes module import paths (#205)
Updates module import paths to ensure correct resolution.
1 parent 88e60e6 commit bfc9adb

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

packages/nextjs-cache-handler/src/instrumentation/register-initial-cache.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { promises as fsPromises } from "node:fs";
22
import path from "node:path";
33
import os from "node:os";
4-
import { PRERENDER_MANIFEST, SERVER_DIRECTORY } from "next/constants";
4+
import { PRERENDER_MANIFEST, SERVER_DIRECTORY } from "next/constants.js";
5+
import { CACHE_ONE_YEAR } from "next/dist/lib/constants.js";
56
import type { PrerenderManifest } from "next/dist/build";
6-
import { CACHE_ONE_YEAR } from "next/dist/lib/constants";
77
import {
88
CachedFetchValue,
99
CachedRouteValue,
@@ -329,25 +329,25 @@ export async function registerInitialCache(
329329
}),
330330
isAppRouter
331331
? fsPromises
332-
.readFile(`${pathToRouteFiles}.prefetch.rsc`, "utf-8")
333-
.then((data) => data)
334-
.catch((error) => {
335-
if (debug) {
336-
console.warn(
337-
"[CacheHandler] [%s] %s %s",
338-
"registerInitialCache",
339-
"Failed to read page prefetch data, assuming it does not exist",
340-
`Error: ${error}`,
341-
);
342-
}
343-
344-
return undefined;
345-
})
332+
.readFile(`${pathToRouteFiles}.prefetch.rsc`, "utf-8")
333+
.then((data) => data)
334+
.catch((error) => {
335+
if (debug) {
336+
console.warn(
337+
"[CacheHandler] [%s] %s %s",
338+
"registerInitialCache",
339+
"Failed to read page prefetch data, assuming it does not exist",
340+
`Error: ${error}`,
341+
);
342+
}
343+
344+
return undefined;
345+
})
346346
: undefined,
347347
isAppRouter
348348
? fsPromises
349-
.readFile(`${pathToRouteFiles}.meta`, "utf-8")
350-
.then((data) => JSON.parse(data) as NextRouteMetadata)
349+
.readFile(`${pathToRouteFiles}.meta`, "utf-8")
350+
.then((data) => JSON.parse(data) as NextRouteMetadata)
351351
: undefined,
352352
]);
353353
} catch (error) {

0 commit comments

Comments
 (0)