There was an error while loading. Please reload this page.
1 parent aa7723b commit e343288Copy full SHA for e343288
lib/helpers/getPagesManifest.js
@@ -1,11 +1,11 @@
1
const { join } = require("path");
2
-const { readJSONSync } = require("fs-extra");
+const { existsSync, readJSONSync } = require("fs-extra");
3
const { NEXT_DIST_DIR } = require("../config");
4
5
const getPagesManifest = () => {
6
- const contents = readJSONSync(
7
- join(NEXT_DIST_DIR, "serverless", "pages-manifest.json")
8
- );
+ const manifestPath = join(NEXT_DIST_DIR, "serverless", "pages-manifest.json");
+ if (!existsSync(manifestPath)) return {};
+ const contents = readJSONSync(manifestPath);
9
// Next.js mistakenly puts backslashes in certain paths on Windows, replace
10
Object.entries(contents).forEach(([key, value]) => {
11
contents[key] = value.replace(/\\/g, "/");
0 commit comments