Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on May 10, 2021. It is now read-only.

Commit e343288

Browse filesBrowse files
add check if pages-manifest exists before reading (#147)
1 parent aa7723b commit e343288
Copy full SHA for e343288

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎lib/helpers/getPagesManifest.js

Copy file name to clipboardExpand all lines: lib/helpers/getPagesManifest.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
const { join } = require("path");
2-
const { readJSONSync } = require("fs-extra");
2+
const { existsSync, readJSONSync } = require("fs-extra");
33
const { NEXT_DIST_DIR } = require("../config");
44

55
const getPagesManifest = () => {
6-
const contents = readJSONSync(
7-
join(NEXT_DIST_DIR, "serverless", "pages-manifest.json")
8-
);
6+
const manifestPath = join(NEXT_DIST_DIR, "serverless", "pages-manifest.json");
7+
if (!existsSync(manifestPath)) return {};
8+
const contents = readJSONSync(manifestPath);
99
// Next.js mistakenly puts backslashes in certain paths on Windows, replace
1010
Object.entries(contents).forEach(([key, value]) => {
1111
contents[key] = value.replace(/\\/g, "/");

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.