Ask coding questions

← Back to all posts
Getting error for line that doesn't exist
piguyisme (5)

I'm working on a sort of reddit clone, and I can share the whole code, but it has account info so I can't share the whole project. However, for some reason it's giving me an error for a line that doesn't even exist. Here is the error code:

/home/runner/project4a/index.js:323
function getFileData
         ^^^^^^^^^^^

SyntaxError: Unexpected end of input

I was using a function to update json files but then deleted it, but it's saying it's still there. How can I get rid of this?

Comments
hotnewtop
mwilki7 (1136)

have you tried copy pasting your code into an editor?
visual studio sometimes gets rid of weird endline characters for me

abc3354 (225)

Hello !
You should check the file index.js and be sure there's nothing at this line.
I cannot help you more than that without the file sorry :(

Note that you can use a .env file to store the accounts or the tokens !


If you found my answer helpful, you can mark it as the answer or upvote it :)
Please, do not hesitate to ask in comments if you have any question
Replmail is a cool mail system create by MrEconomical, give it a try ;)
Yep, this is an ad ^

piguyisme (5)

@abc3354 I forked it to remove account info and the code I deleted came back when I forked it. It must be still stored there but i can't interact with it, so its a problem with repl.it.

abc3354 (225)

@piguyisme Maybe the file wasn't saved when you forked it
What do you mean by "i can't interact with it" ?

piguyisme (5)

@abc3354 I think the line of code is there, but repl isn't showing it to me and only executng it. When I forked it it might have done some reload thing that allowed me to see it in the forked project.

abc3354 (225)

@piguyisme You can try to report it on replit bugs but without a repl it will be difficult to find the bug

Did the fork work ?