Error formatting document
See original GitHub issueHey there! I’m getting this error in the VS code output console when trying to format a rather large .vue file. (SFC with script setup
). I tried a bunch of files and this one isn’t formatting properly, all others work super smooth. I can’t share the exact file but I can provide some more details if necessary.
prettier
version: 2.5.1
prettier-plugin-tailwindcss
version: 0.1.3
tailwindcss
version: 3.0.16
["ERROR" - 8:15:05 AM] Error formatting document.
TypeError: Cannot read property 'includes' of null
at Lr (/Users/.../node_modules/prettier-plugin-tailwindcss/dist/index.js:145:943)
at n (/Users/.../node_modules/prettier-plugin-tailwindcss/dist/index.js:145:2520)
at n (/Users/.../node_modules/prettier-plugin-tailwindcss/dist/index.js:145:2956)
at n (/Users/.../node_modules/prettier-plugin-tailwindcss/dist/index.js:145:2956)
at n (/Users/.../node_modules/prettier-plugin-tailwindcss/dist/index.js:145:2956)
at n (/Users/.../node_modules/prettier-plugin-tailwindcss/dist/index.js:145:2956)
at Object.parse (/Users/.../node_modules/prettier-plugin-tailwindcss/dist/index.js:145:2363)
at Object.parse$d [as parse] (/Users/.../node_modules/prettier/index.js:12975:19)
at coreFormat (/Users/.../node_modules/prettier/index.js:14525:16)
at formatWithCursor$1 (/Users/.../node_modules/prettier/index.js:14765:14)
at /Users/.../node_modules/prettier/index.js:60959:12
at Object.Success [as format] (/Users/.../node_modules/prettier/index.js:60979:12)
at t.default.<anonymous> (/Users/.../.vscode/extensions/esbenp.prettier-vscode-9.1.0/src/PrettierEditService.ts:435:45)
at Generator.next (<anonymous>)
at s (/Users/.../.vscode/extensions/esbenp.prettier-vscode-9.1.0/dist/extension.js:1:7872)
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Why does Prettier not format code in VS Code? - Stack Overflow
Sometimes, prettier stops working when there are syntactic errors in the code. ... Command + Shift + p; type format document with ...
Read more >Cannot use Prettier formatting (Maybe VS code update broke it?)
Steps To Reproduce: Right click document; Click Format Document; Get error saying it cannot format document; Check default formatter; Prettier ...
Read more >Prettier not working in VSCode - possible fixes - LinuxPip
In VSCode, open a HTML/JS file and open the Command Palette by selecting View > Command Palette or press Ctrl+Shift+P and search for...
Read more >E-Filing Document indentified as 'Format Error' FAQ
In the event of a filing not being successful processed and identified with a 'Format Error', indicates that the filing has one or...
Read more >Prettier - Code formatter - Visual Studio Marketplace
CMD + Shift + P -> Format Document OR 1. ... If you see this error, it most likely means you need to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rbluethl Are you certain that you’re on
0.1.4
? You may need to run theDeveloper: Restart Extension Host
command in VS Code to get the Prettier extension to pick up the new versionAh, snap! That was it… sorry for that! Thank you for the awesome plugin & quick help/fix! 👍