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

Errors when running with '--write **/*' #844

Closed
andyw8 opened this issue Mar 19, 2021 · 1 comment · Fixed by #846
Closed

Errors when running with '--write **/*' #844

andyw8 opened this issue Mar 19, 2021 · 1 comment · Fixed by #846

Comments

@andyw8
Copy link
Contributor

andyw8 commented Mar 19, 2021

👋 Trying out prettier on a new Rails project, I ran the README suggestion of:

bundle exec rbprettier --write '**/*'

And I get a lots of error output such as:

[error] No parser could be inferred for file: .browserslistrc
[error] No parser could be inferred for file: .byebug_history
[error] No parser could be inferred for file: .env
[error] No parser could be inferred for file: .env.test
[error] No parser could be inferred for file: .gitattributes
.github/workflows/ruby.yml
[error] .github/workflows/ruby.yml: Error: Cannot find module './parser-yaml'
[error] Require stack:
[error] - /Users/andyw8/.gem/ruby/2.7.2/gems/prettier-1.5.4/node_modules/prettier/index.js
[error] - /Users/andyw8/.gem/ruby/2.7.2/gems/prettier-1.5.4/node_modules/prettier/bin-prettier.js
[error]     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:892:15)
[error]     at Function.Module._load (internal/modules/cjs/loader.js:742:27)
[error]     at Module.require (internal/modules/cjs/loader.js:964:19)
[error]     at require (internal/modules/cjs/helpers.js:88:18)
[error]     at Object.get yaml [as yaml] (/Users/andyw8/.gem/ruby/2.7.2/gems/prettier-1.5.4/node_modules/prettier/index.js:57415:12)
[error]     at resolveParser (/Users/andyw8/.gem/ruby/2.7.2/gems/prettier-1.5.4/node_modules/prettier/index.js:13587:21)
[error]     at normalize$1 (/Users/andyw8/.gem/ruby/2.7.2/gems/prettier-1.5.4/node_modules/prettier/index.js:13695:18)
[error]     at format (/Users/andyw8/.gem/ruby/2.7.2/gems/prettier-1.5.4/node_modules/prettier/index.js:15111:46)
[error]     at Object.formatWithCursor (/Users/andyw8/.gem/ruby/2.7.2/gems/prettier-1.5.4/node_modules/prettier/index.js:57542:12)
[error]     at format (/Users/andyw8/.gem/ruby/2.7.2/gems/prettier-1.5.4/node_modules/prettier/bin-prettier.js:15883:14)
[error] No parser could be inferred for file: .gitignore

I'm not sure if this is an oversight in the README, i.e. it should instead be **/*.rb, or if there's some other issue happening?

Using v1.5.4 but I tried v1.5.0 and got the same result.

@kddnewton
Copy link
Member

Oh interesting. That's an oversight in the gem version. If you use the package it should work.

tl;dr, I think I'm not sending all of the requisite node modules in the gem. I'll get this fixed, thanks!

kddnewton added a commit that referenced this issue Mar 23, 2021
@kddnewton kddnewton mentioned this issue Mar 23, 2021
kddnewton added a commit that referenced this issue Mar 23, 2021
kddnewton pushed a commit that referenced this issue Mar 23, 2021
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

Successfully merging a pull request may close this issue.

2 participants