question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error formatting document

See original GitHub issue

Hey 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:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bradlccommented, Jan 25, 2022

@rbluethl Are you certain that you’re on 0.1.4? You may need to run the Developer: Restart Extension Host command in VS Code to get the Prettier extension to pick up the new version

0reactions
rbluethlcommented, Jan 25, 2022

Ah, snap! That was it… sorry for that! Thank you for the awesome plugin & quick help/fix! 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found