Skip to content

Lesson 10: Error "Unexpected end of JSON input" #1129

Answered by BenRai1
BenRai1 asked this question in Q&A
Discussion options

You must be logged in to vote

Turns out, this error happens when you pass an empty file into

const contractAddresses = JSON.parse(fs.readFileSync(FRONT_END_ADDRESSES_FILE, "utf8"))

To fix it you just need to put "{ }" in the file "contractAddresses.json" in the frontend project

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@MarsIfeanyi
Comment options

Comment options

You must be logged in to vote
3 replies
@oojoseph67
Comment options

@krakxn
Comment options

@Bhavik-punmiya
Comment options

Answer selected by BenRai1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants