NiklasPor / prettier-plugin-go-template

Fixes prettier formatting for go templates 🐹
prettier-plugin-go-template-niklaspor.vercel.app
MIT License
343 stars 24 forks source link

Error - Found invalid node block #83

Closed reggieds closed 2 years ago

reggieds commented 2 years ago

I've got this error while reformat using prettier on Hugo HTML document.

["INFO" - 7:41:36 PM] Extension Name: esbenp.prettier-vscode.
["INFO" - 7:41:36 PM] Extension Version: 9.5.0.
["INFO" - 7:41:42 PM] File Info:
{
  "ignored": false,
  "inferredParser": "go-template"
}
["ERROR" - 9:41:22 PM] Error formatting document.
["ERROR" - 9:41:22 PM] An error occured during printing. Found invalid node block.
Error: An error occured during printing. Found invalid node block.
    at Object.print (/usr/local/lib/node_modules/prettier-plugin-go-template/src/index.ts:89:13)
    at callPluginPrintFunction (/usr/local/lib/node_modules/prettier/index.js:8447:26)

My VSCode settings:

  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "prettier.prettierPath": "/usr/local/lib/node_modules/prettier"
NiklasPor commented 2 years ago

Please provide the HTML template which caused this issue. Otherwise there's no way to debug this 👍

jasikpark commented 2 years ago

Would you mind adding which version of prettier-plugin-go-template you have installed as well?

reggieds commented 2 years ago

Would you mind adding which version of prettier-plugin-go-template you have installed as well?

My prettier-plugin-go-template package version:

npm list -g --depth=0
/usr/local/lib
├── @nestjs/cli@8.2.5
├── bower@1.8.14
├── gatsby-cli@4.12.1
├── gulp-cli@2.3.0
├── npm@8.7.0
├── prettier-plugin-go-template@0.0.12
├── prettier@2.6.2
└── yo@4.3.0
reggieds commented 2 years ago

Error gone after I reinstall my vscode prettier extension. Thanks all.

jasikpark commented 2 years ago

good luck then 👍