You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to format the code using the Prettier API. I am using Next.js Server Component. I am trying to implement it within the beforeHighlight function in the extensions hook. However, the issue arises because the Prettier format function returns a promise, whereas beforeHighlight does not expect a promise.
How can I resolve this problem? I prefer not to place the Prettier logic in the client component. Can anyone please assist me with this?
Isn't nice if somehow beforeHighlight function resolve the promise, then the problem would be solved very easily.
The text was updated successfully, but these errors were encountered:
If I console log the formattedCode, I'm getting the correct formatting but it is showing the unformatted code in the browser. Am I missing something ??
I want to format the code using the Prettier API. I am using Next.js Server Component. I am trying to implement it within the beforeHighlight function in the extensions hook. However, the issue arises because the Prettier format function returns a promise, whereas beforeHighlight does not expect a promise.
How can I resolve this problem? I prefer not to place the Prettier logic in the client component. Can anyone please assist me with this?
Isn't nice if somehow beforeHighlight function resolve the promise, then the problem would be solved very easily.
The text was updated successfully, but these errors were encountered: