Do not silently ignore package.json in zeit deployment #1540
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.
What kind of change does this PR introduce?
Fix
What is the current behavior?
If you omit the
files
entry in yournow.json
then the deployment works without any issues but if you customize thenow.files
and you happen to havepackage.json
in that list, it will be ignored from the deployment. If the package.json is omitted then zeit won't install the required dependencies.Example configuration:
now.json
package.json
index.js
The deployment of a sandbox with the configuration above will be successful but when you are trying to open your deployment it'll crash with an error of 500. (
MODULE_NOT_FOUND
)What is the new behavior?
If the user add
package.json
to thenow.files
it'll be included.Checklist:
I found this issue while I was building a Pusher authentication server using zeit for a sample vue chat app. I had to define the
now.files
since the sandbox has lots of files (config, static, build, etc) which should be deployed to zeit (and cannot be due to some zeit errors). For now, I moved the server to a different sandbox and deployed from there.