Why does Replit sometimes fail to format my files?

Sometimes when I format my JavaScript file, it succeeds and gives me this message: Formatted script.js successfully but sometimes, it just refuses and gives me this message: Failed to format script.js. Why?
Also Prettier should be built in to Replit. Why is it an extension?

Typically for me, if formatting fails it’s because of an error in the code. Replit doesn’t/shouldn’t format broken code, or they’d risk breaking it further.

2 Likes

Yeah but I didn’t have any errors?

1 Like

What is the link to your Repl? What template are you using?

2 Likes

On most of my repls, not only one, with the template HTML, CSS, JS but I’m pretty sure it’s for every template that uses javascript

1 Like

It happens to me too. This is mainly happening to .js files. I think this is because Replit can’t tell if the language is JavaScript Frontend or Node.js.

2 Likes

Ok I’ll just use Prettier then

1 Like

Formatting these is the same, they are both just JavaScript (NodeJS isn’t a language), so that wouldn’t be the issue.

3 Likes

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