fix(v2): Don't error if site has no dependencies list #5205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We noticed that when a site has no
dependencies
in its package.json, you sometimes get errors when runningyarn start
.Oddly, its intermittent, seems to occur the first or second time you run
yarn start
after a yarn install, but not consistently. We observed it on the flipper website which only has devDependencies, and no dependencies array.I think it's reasonable that a lot of sites only need
devDependencies
so this prevents erroring in those cases.Have you read the [Contributing Guidelines on pull requests]?
Yes
Test Plan
Happy case still succeeds:
I'm unfortunately submitting this fix blind as the issue is intermittent and hard to reproduce.
This is a stack trace from when the problem occurred, which pretty clearly points to where it's happening:
Searching the code for
dependencies
doesn't show any other references except for the migration script which already deals with the undefined case.