Skip to content

Fix package.json validation #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2020
Merged

Fix package.json validation #29

merged 1 commit into from
Nov 13, 2020

Conversation

ehmicky
Copy link

@ehmicky ehmicky commented Nov 13, 2020

Fixes #22.

The line checks for packageJson being falsy:

https://github.com/netlify/netlify-plugin-nextjs/blob/2849dc5f7c57e9fd827a939e067a871e4cb487b1/index.js#L21

However, when a site has no package.json, packageJson is an empty object. Therefore, Object.keys(packageJson).length === 0 should be used instead.

This PR also adds a test for it.

@ehmicky ehmicky added the type: bug code to address defects in shipped code label Nov 13, 2020
@ehmicky ehmicky self-assigned this Nov 13, 2020
@ehmicky ehmicky merged commit 4ceb71f into main Nov 13, 2020
@ehmicky ehmicky deleted the bug/package-json branch November 13, 2020 18:45
ascorbic pushed a commit that referenced this pull request Oct 4, 2021
Co-authored-by: Renovate Bot <bot@renovateapp.com>
serhalp pushed a commit that referenced this pull request Apr 5, 2024
* chore: simplify get/remove prerendered content

* chore: pin fastly module

* chore: add a couple comments to storing of prerendered content

* fix: avoid overawaiting when globbing

* feat: add static pages content to CDN

* fix: ensure json data is not bundled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

packageJson is never undefined
2 participants