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.
Yeah but I didn’t have any errors?
What is the link to your Repl? What template are you using?
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
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.
Ok I’ll just use Prettier then
Formatting these is the same, they are both just JavaScript (NodeJS isn’t a language), so that wouldn’t be the issue.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.