GeezerVison is showing github.com — Fixed: Cannot read property 'encode' of undefined during executing writeFile() by makishvili · Pull Request #456 · github-tools/github
Conversation
makishvili
commented
Jun 16, 2017
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
I am trying to execute writeFile without optional options-parameter.
repo.writeFile('master', 'file.txt', 'some text', some message');
But getting the error:
~project/node_modules/github-api/dist/components/Repository.js:912
var shouldEncode = options.encode !== false;
^
TypeError: Cannot read property 'encode' of undefined
at Repository.writeFile (~project/node_modules/github-api/dist/components/Repository.js:912:36)
at Object.<anonymous> (~project/gist.js:13:6)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@makishvili Could you add a test showing the situation you've described? I'd like to see a test pass that wouldn't have passed before.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.