Why isn't my file editor loading?

I created a basic extension and when I try to open a file using my JSON editor, it doesn’t show the test text that should be the name of the file. What did I do wrong?

Here is my code:

async function main() {
  await replit.init();

  const file = await replit.me.filePath();

  document.getElementById("hi").innerText = file;
}
1 Like

I’d suggest trying a console.log and checking the logs to see what the output is, or prepend some text to that filename to see if it’s not empty for some reason

1 Like

Just realized the error. It’s because the main function isn’t getting called.

1 Like

NONO, THAT IS NOT CORRECT, you must revise.

1 Like

Can you please elaborate more on what you are trying to tell me?

1 Like

You’re going to encounter a glitch because I don’t think you’re solution is correct completely

2 Likes

So what is the problem with my code/solution?

3 Likes

Trust me, it probably won’t work correctly. I know that something is wrong, I just don’t know why it’s wrong

2 Likes

That doesn’t even make any sense. The code itself looks fine.

1 Like

I don’t believe so…i think otherwise

2 Likes

How so? You can’t just say it looks wrong without an explanation.

3 Likes

The code is completely fine. (as far as I see)

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.