Bug 474722 - prettier.resolveConfig.sync is not a function
Summary: prettier.resolveConfig.sync is not a function
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 23.08.1
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-20 08:43 UTC by kde
Modified: 2023-10-01 11:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kde 2023-09-20 08:43:00 UTC
SUMMARY
Hello! It's a strange situation that depends on how I edit the document. If I open a document through Dolphin, through the context menu, the "Open with" item, and then edit the document - I save it fine. But if I open Kate and then open the document, I get an error when I save:

[11:33:06  Format Ошибка] TypeError: prettier.resolveConfig.sync is not a function
    at Socket. (/tmp/kate.nEChzR:48:30)
    at Socket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:343:12)
    at readableAddChunk (node:internal/streams/readable:312:11)
    at Readable.push (node:internal/streams/readable:253:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

This is HTML document. My document also exceeds the "Line Length Limit" parameter, perhaps this has some effect.

Before this I installed npm-10.1.0-1, prettier-3.0.3-1, yarn-1.22.19-1, nodejs-20.6.1-1 (Kate was saying that it was missing these packages before it started displaying this error).


STEPS TO REPRODUCE
1. Open Kate.
2. Open HTML-document.
3. Edit.
4. Ctrl-S.


SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Comment 2 Waqar Ahmed 2023-10-01 11:39:08 UTC
Git commit f3f834990525b25347a2fd238eca3061abdc8215 by Waqar Ahmed.
Committed on 01/10/2023 at 13:38.
Pushed by waqar into branch 'master'.

Fix prettier.resolveConfig.sync is not a function

await the functions, they are async now. For older version it will
continue to work as awaiting a sync function is allowed.

M  +2    -3    addons/format/prettier_script.js

https://invent.kde.org/utilities/kate/-/commit/f3f834990525b25347a2fd238eca3061abdc8215
Comment 3 Waqar Ahmed 2023-10-01 11:40:04 UTC
Git commit 1ac4542290a2205e93069495f0a7b6e4ae2ed453 by Waqar Ahmed.
Committed on 01/10/2023 at 13:39.
Pushed by waqar into branch 'release/23.08'.

Fix prettier.resolveConfig.sync is not a function

await the functions, they are async now. For older version it will
continue to work as awaiting a sync function is allowed.
(cherry picked from commit f3f834990525b25347a2fd238eca3061abdc8215)

M  +2    -3    addons/format/prettier_script.js

https://invent.kde.org/utilities/kate/-/commit/1ac4542290a2205e93069495f0a7b6e4ae2ed453