Closed Randy1Burrell closed 11 months ago
It looks like this might be related to #125? Prettier v3 may not be supported yet, before the PR #124 is merged.
Either #124 didn't fix the problem, or it hasn't made it's way to melpa. It looks to me like the version on melpa includes the changes from #124, but I don't really understand how that package index works, so I may be wrong. Regardless, I'm running into the same issue having upgraded to prettier v3.
Downgrading prettier to v2 "fixed" this for me. There's some additional info here that might also help.
It seems to work fine here with Prettier 3.1.0.
Are you perhaps using MELPA Stable? I don't think I've rolled a new stable release yet.
Check M-x package-list-packages
to see which version of the prettier
package you have installed (20231002.1153
here.)
Closing this for now, I'm pretty certain this is sorted. Feel free to open a new ticket if you're still running into troubles but would be good to see details on what exactly your setup looks like.
I was getting this with the latest master
, but managed to fix it somehow - probably by running make
to rebuild prettier-el.js.gz.base64
although I'm not entirely sure. Unfortunately I can't tell what version of prettier is/was in use, because for some reason #97 hasn't been merged yet. I think this warrants another plea for progress on #92 because things seem to go wrong with prettier.el
most times I update it or some other aspect of local setup changes, and currently it's still very difficult to figure out what's going on.
This can be a good plugin, because the concept is great. Especially, coming from the other prettier-mode and I needed something that could work with my local prettier file, without having to do a folder level emacs config. However, I decided to switch to Apheleia mode since this doesn't work. Might rally back here if... Or build my own.
@Randy1Burrell how is it not working?
@jscheid It's not that it doesn't work. It just doesn't work for me. I need a tool to help me achieve a task, not something that I need to worry about upgrading my prettier package will cause it to break and mess up my whole file, even if I have another plugin installed that conflicts with it. I need my tool to work and not have to configure it all the time. My editor is about writing code and it didn't work for me, and I had to spend days wondering why. That's too much time if you ask me.
There was a time when I was all about hacking tools and systems to make them work. However, I figure that since that doesn't create value I need to leave that to the professionals, such as yourself, and focus on actually creating value for others. So unless I need a tool, it's not worth the time to figure out how to fix it. That's why I decided to change to a Mac, and stopped hacking my Linux box to do everything known to man.
I just tried upgrading the prettier npm package again and it now seems to be working for me. I can confirm that I'm running prettier.el 20231002.1153
with prettier v3.1.1. Something must have been cached or misconfigured somehow the first time I tried :shrug:
@jscn glad to hear it, thanks for the update.
@Randy1Burrell it sounds like you're happy with Apheleia, that's great. You should stick with it if it works for you.
I'm certainly not trying to sell you on anything, but for the benefit of other readers: it's not necessary to "keep upgrading" this package. Prettier 3.0.0 broke API compatibility in a major way and since we're consuming the API this did require an upgrade to retain compatibility.
It may well happen again some day, but this was the only breaking change affecting us in all the years that this package has existed. (There were breaking API changes in Prettier 2.0.0 but they were to functions we're not using.)
The other packages, such as Apheleia, use the Prettier CLI, which is more stable. So yes -- if stability is your main concern you should probably use one of the alternatives.
I think it's also fair to say that the other packages are all quite a bit simpler than this one, which perhaps means less need for fiddling overall. In exchange for the added complexity of this package you're getting lower latency, which is important to me. It may not be important to everyone and that's absolutely fine, pick what works best for you.
One last thing, I've been dogfooding this package on a daily basis since 2018 and I can't remember the last time it's misbehaved and I had to fiddle with it. For my use cases it "just works", YMMV.
@jscheid to your point regarding the latency. I would have loved it if this tool worked out for me because that is also super important to me and I appreciated the time you took to build it. You built it so you know what works and what to fix if needs be. I believe that if this tool works when you install it then you should stick with it because the improvements vs other plugins that do the same things are just enormous.
I'm happy with Apheleia to a certain degree. It works for now but the latency nags but hey it worx right now until I have time in the future to fiddle and test this plugin again.
Describe the bug When prettier runs I get this error
TypeError: n.resolveConfig.sync is not a function
Link to
M-x prettier-info
outputTo Reproduce Install Prettier -> Open any files that Prettier will run in -> Make an edit -> Save the file
Expected behavior Prettier should format the buffer properly
Additional context Add any other context about the problem here.