maxime1992 / dev.to

[Template] My dev.to articles
58 stars 12 forks source link

Error: The command "yarn run prettier:check" exited with 1. #6

Closed xJuggl3r closed 4 years ago

xJuggl3r commented 5 years ago

Hi

I'm using the template you provided Nothing much is changed, excepting for the info that need to be replaced.

I'm constantly receiving the error: The command "yarn run prettier:check" exited with 1.

I tried to remove prettier with no success... This is what I've got:

yarn run v1.15.2
warning package.json: No license field
error Command "test" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command "yarn test" exited with 1.
cache.2
store build cache
0.00s1.14snothing changed
Done. Your build exited with 1.

do you know what it might be?

HDv2b commented 5 years ago

can confirm I have the same problem, travis log:

...
0.43s$ yarn
yarn install v1.3.2
(node:5896) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
warning package.json: No license field
warning dev.to: No license field
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.12s.
1.85s$ yarn run prettier:check
yarn run v1.3.2
(node:5922) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
warning package.json: No license field
$ yarn run prettier:base --list-different
(node:5945) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
warning package.json: No license field
$ yarn run prettier "**/*.{js,json,scss,md,ts,html,component.html}" --list-different
(node:5968) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
warning package.json: No license field
$ prettier '**/*.{js,json,scss,md,ts,html,component.html}' --list-different
blog-posts/test/test.md
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command "yarn run prettier:check" exited with 1.
...
maxime1992 commented 5 years ago

Damn I randomly found this issue. It feels like I've been missing quite a few recently. I'm using Octobox to track the issues I wonder if something is wrong there or just on my side 🙄

Anyway can't check today but I'll try to have a look tomorrow!

maxime1992 commented 5 years ago

@xJuggl3r @ElGoorf could you please try to give me more info?

Because it seems to be all good on my side.

Are you using windows? Could it be a CR LF diff between Windows and Linux on CI?

Give me as much details as you can think of :)

HDv2b commented 5 years ago

I am on windows, so that might be part of the problem. I'll be able to check next week.

maxime1992 commented 5 years ago

Good, at least we've got a clue!

You may want to use git config core.autocrlf true as a git setting maybe if you're working from a Windows machine.

I think this issue can be closed but I'll let it opened for a few weeks, let me know once you've checked =)

HDv2b commented 5 years ago

playing around with CRLF in both git config and also editor config did nothing to help. I did a yarn upgrade-interactive --latest, updated the two packages, and then tried again, still no luck. But then I went through with pretter:base and prettier:write both worked, and then prettier:check worked afterwards.

maxime1992 commented 5 years ago

:point_up: https://github.com/maxime1992/my-dev.to is my personal fork of https://github.com/maxime1992/dev.to, please report issues with the template on the latter :smiley_cat:

(I've transferred the issue so all good for this one)

maxime1992 commented 5 years ago

But then I went through with pretter:base and prettier:write both worked, and then prettier:check worked afterwards.

Oh sorry, I should mention the workflow here with prettier. The idea is that locally you should run prettier:write to fix the formatting in the project which is then checked automatically on CI.

If the formatting was not correct from prettier point of view it's normal that it was failing on CI :+1:

I'll edit the readme to explain this :)

maxime1992 commented 4 years ago

Closing as I think it's been solved. Feel free to reopen if needed :+1: