prettier-plugin-erb
prettier-plugin-erb copied to clipboard
TypeError: formattedExpression.trim is not a function
Hi :wave:
I'm getting this error on all my erb files! Any suggestion?
$ node -v
v12.21.0
$ yarn prettier --check app/**/*.rb
yarn run v1.22.11
Checking formatting...
All matched files use Prettier code style!
✨ Done in 3.01s.
$ yarn prettier --check 'app/**/*.erb'
Checking formatting...
app/views/administrador/_tabla_estudios_contables.html.erb[error] app/views/administrador/_tabla_estudios_contables.html.erb: TypeError: formattedExpression.trim is not a function
[error] at /Users/pablo/Projects/xxx/node_modules/prettier-plugin-erb/lib/formatter.js:28:46
[error] at Array.map (<anonymous>)
[error] at formatMultilineExpressions (/Users/pablo/Projects/xxx/node_modules/prettier-plugin-erb/lib/formatter.js:7:6)
[error] at Object.print (/Users/pablo/Projects/xxx/node_modules/prettier-plugin-erb/lib/printers.js:22:27)
[error] at callPluginPrintFunction (/Users/pablo/Projects/xxx/node_modules/prettier/index.js:13787:21)
[error] at mainPrintInternal (/Users/pablo/Projects/xxx/node_modules/prettier/index.js:13725:17)
[error] at mainPrint (/Users/pablo/Projects/xxx/node_modules/prettier/index.js:13707:14)
[error] at printAstToDoc (/Users/pablo/Projects/xxx/node_modules/prettier/index.js:13694:13)
[error] at coreFormat (/Users/pablo/Projects/xxx/node_modules/prettier/index.js:14055:15)
[error] at formatWithCursor$1 (/Users/pablo/Projects/xxx/node_modules/prettier/index.js:14284:14)
I'm seeing this too.
Same for me as well
Same here.
Same!
It seems like the issue occurs in combination with the new release of version 2.0.0 of @prettier/plugin-ruby. I downgraded to "@prettier/plugin-ruby": "1.6.1"
and formatting is working now again as expected 🚀
It seems like the issue occurs in combination with the new release of version 2.0.0 of @prettier/plugin-ruby. I downgraded to
"@prettier/plugin-ruby": "1.6.1"
and formatting is working now again as expected 🚀
This didn't work for me. I restarted VS Code and still got the "..trim" error
@akimthedream Hello, can we please see your package.json, tried to downgrade but it wipes out much of the code on save and changes the html tags to
It would be big help! thank you, if you have time.
"devDependencies": {
"@prettier/plugin-ruby": "1.6.1",
"prettier": "1.9.0",
"prettier-plugin-erb": "^0.4.0",
"webpack-dev-server": "^3"
}
This combination worked for me -
"@prettier/plugin-ruby": "1.6.1",
"prettier": "2.2.0",
"prettier-plugin-erb": "^0.4.0"
This is all related to #49