Issue when running prettier for any APEX class in my project #16139
Labels
locked-due-to-inactivity
Please open a new issue and fill out the template instead of commenting.
scope:plugin
The requested enhancement doesn't belong in Prettier core, but would be a good fit for a plugin
Environments:
Steps to reproduce:
Try to run the following command :
prettier force-app/main/default/classes/Test.cls --write
On any apex class : e.g :
public with sharing class Test {
}
Expected behavior:
Success
Actual behavior:
PS C:\Projects\booster-lwr> prettier force-app/main/default/classes/Test.cls --write
[error] force-app/main/default/classes/Test.cls: TypeError: Cannot read properties of undefined (reading 'unit')
[error] at AstPath.call (file:///C:/Users/bbedford/AppData/Roaming/npm/node_modules/prettier/index.mjs:20749:20)
[error] at genericPrint (file:///C:/Projects/booster-lwr/node_modules/prettier-plugin-apex/dist/src/printer.js:2685:24)
[error] at Object.printGenerically [as print] (file:///C:/Projects/booster-lwr/node_modules/prettier-plugin-apex/dist/s
rc/printer.js:2713:17)
[error] at callPluginPrintFunction (file:///C:/Users/bbedford/AppData/Roaming/npm/node_modules/prettier/index.mjs:22303
:20)
[error] at printAstToDoc (file:///C:/Users/bbedford/AppData/Roaming/npm/node_modules/prettier/index.mjs:22258:22)
[error] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[error] at async coreFormat (file:///C:/Users/bbedford/AppData/Roaming/npm/node_modules/prettier/index.mjs:22611:14)
[error] at async formatWithCursor (file:///C:/Users/bbedford/AppData/Roaming/npm/node_modules/prettier/index.mjs:22809:
14)
[error] at async formatFiles (file:///C:/Users/bbedford/AppData/Roaming/npm/node_modules/prettier/internal/cli.mjs:6673
:18)
[error] at async main (file:///C:/Users/bbedford/AppData/Roaming/npm/node_modules/prettier/internal/cli.mjs:7081:5)
The text was updated successfully, but these errors were encountered: