Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: formattedExpression.trim is not a function #87

Open
vizcay opened this issue Oct 30, 2021 · 9 comments
Open

TypeError: formattedExpression.trim is not a function #87

vizcay opened this issue Oct 30, 2021 · 9 comments

Comments

@vizcay
Copy link

vizcay commented Oct 30, 2021

Hi πŸ‘‹

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)
@abuzzell
Copy link

abuzzell commented Nov 1, 2021

I'm seeing this too.

@3atharvkurdukar
Copy link

Same for me as well

@sonnypgs
Copy link

sonnypgs commented Nov 4, 2021

Same here.

@akimthedream
Copy link

Same!

@akimthedream
Copy link

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 πŸš€

@alanjudson
Copy link

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

@ghost
Copy link

ghost commented Dec 5, 2021

@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 I'm trying to guess which combination we need.

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"
 }

@joshunger
Copy link

joshunger commented Feb 11, 2022

This combination worked for me -

"@prettier/plugin-ruby": "1.6.1",
"prettier": "2.2.0",
"prettier-plugin-erb": "^0.4.0"

@tmaier
Copy link

tmaier commented Mar 31, 2022

This is all related to #49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants