Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

add check if pages-manifest exists before reading #147

Merged
merged 1 commit into from
Jan 19, 2021

Conversation

lindsaylevine
Copy link
Contributor

Fixes #136

@lindsaylevine lindsaylevine added the type: bug code to address defects in shipped code label Jan 17, 2021
join(NEXT_DIST_DIR, "serverless", "pages-manifest.json")
);
const manifestPath = join(NEXT_DIST_DIR, "serverless", "pages-manifest.json");
if (!existsSync(manifestPath)) return {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure: would next-on-netlify still behave correctly even if this function returns an empty object?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes! each place that uses getPagesManifest iterates over it using Object.entries

so it'd be calling Object.entries({}) which returns an empty array meaning no pages will get included (as appropriate, if there's somehow no pages-manifest) for the relevant page types

@lindsaylevine lindsaylevine merged commit e343288 into main Jan 19, 2021
@lindsaylevine lindsaylevine deleted the ll/missing-pages-manifest branch January 19, 2021 13:56
lindsaylevine added a commit that referenced this pull request Jan 26, 2021
- Put back next/image support ([#158](#158))
- Fix: strip file extension when checking if route is dynamic ([#155](#155))
- Fix: prevent copy of .public to .public ([#146](#146))
- Fix: add check if pages-manifest exists before reading ([#147](#147))
- Fix: throw error if .next/static cannot be found ([#148](#148))
- Fix: remove unnecessary * from headers rule ([#152](#152))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing pages-manifest.json
2 participants