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: prettier.resolveConfig.sync is not a function #105

Closed
ppvg opened this issue Sep 8, 2017 · 17 comments · Fixed by prettier/prettier-eslint#125
Closed

TypeError: prettier.resolveConfig.sync is not a function #105

ppvg opened this issue Sep 8, 2017 · 17 comments · Fixed by prettier/prettier-eslint#125

Comments

@ppvg
Copy link

ppvg commented Sep 8, 2017

It looks like there is a regression in 4.3.2:

$ node_modules/.bin/prettier-eslint path/to/file.js
prettier-eslint-cli [ERROR]: There was an error formatting "path/to/file.js":
    TypeError: prettier.resolveConfig.sync is not a function
        at getPrettierConfig (node_modules/prettier-eslint/dist/index.js:233:33)
        at format (node_modules/prettier-eslint/dist/index.js:90:51)
        at MapSubscriber.project (node_modules/prettier-eslint-cli/dist/format-files.js:275:55)
        at MapSubscriber._next (node_modules/rxjs/operator/map.js:77:35)
        at MapSubscriber.Subscriber.next (node_modules/rxjs/Subscriber.js:89:18)
        at AsyncSubject.Subject.next (node_modules/rxjs/Subject.js:55:25)
        at AsyncSubject.complete (node_modules/rxjs/AsyncSubject.js:46:35)
        at handlerFn (node_modules/rxjs/observable/BoundNodeCallbackObservable.js:193:33)
        at tryToString (fs.js:456:3)
        at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)

This only happens with version 4.3.2, not with 4.3.1 versions 4.3.2 and 4.3.1, not with 4.3.0.
It also happens without a .prettierrc file.

  • prettier-eslint-cli version: 4.3.2
  • prettier-eslint version: 8.0.0
  • eslint version: 4.6.1
@keepitterron
Copy link

This commit is causing this error: prettier/prettier-eslint@e39719e

the function resolveConfig.sync does not seem to exist. I have the same error on a different prettier-eslint-cli

@kentcdodds
Copy link
Member

Could you delete your node_modules and reinstall everything? My guess is that you have an old version of prettier... cc @robwise

@keepitterron
Copy link

I might be wrong, but this is the last commit for the prettier build: https://github.com/prettier/prettier/blob/c3506198c007e6667975b3dbf958b8b06550f4a8/website/static/lib/index.js

there is no resolveConfig.sync? I'm running prettier 1.6.1 which is the latest.
I have the same issue with 4.3.1 and not with 4.3.0

@marcbachmann
Copy link

marcbachmann commented Sep 8, 2017

@kentcdodds I don't think that the resolveConfig.sync is in the published prettier module yet.
That landed 7 days ago on master. prettier/prettier#2722
The most recent release was 10 days ago.

.... I also just upgraded to node 8.4 and have the same issues with a clean install.

@bardware
Copy link

bardware commented Sep 8, 2017

Emptied my node_modules folder follwed by npm i
no help :(

@kentcdodds
Copy link
Member

Ah yes, well that's a problem... cc @robwise

I suggest locking down to prettier-eslint-cli@4.3.0 until the next version of prettier gets released.

I'm not using prettier-eslint anymore (I'm just using prettier) so I'm afraid my time on the project is pretty limited. If someone wants to take up the torch let me know :)

@bardware
Copy link

bardware commented Sep 8, 2017

I'm not using prettier-eslint anymore (I'm just using prettier)

The eslint folks keeps insisting eslint is much more than a prettifier. I love to use both. Your tool combines them nicely.

@kentcdodds
Copy link
Member

I use both as well, but I don't use eslint for formatting, I use it for catching bugs that cannot be autofixed 😄

I'm glad you like my tool though!

@robwise
Copy link

robwise commented Sep 8, 2017

double oops, sorry I totally didn't realize that wasn't part of the original resolveConfig release, I just read it in the manual and didn't even think to check

@diondirza
Copy link
Contributor

diondirza commented Sep 13, 2017

Just upgraded from 4.1.1 and the error occurred, seems 4.1.1 working fine without this error. Also 4.3.1 produce the very same error.

@bkw
Copy link

bkw commented Sep 13, 2017

prettier-1.6.2 is (which will include prettier/prettier#2722) is about to be released faily soon, see prettier/prettier#2804.

@gb714us
Copy link

gb714us commented Sep 14, 2017

prettier 1.7.0 is out. They had to upgrade to a minor version.

@kentcdodds
Copy link
Member

Thanks!

@bkw
Copy link

bkw commented Sep 15, 2017

shouln't we bump the depenency on prettier-eslint here in cli?

@TroublemakerSt
Copy link

I upgraded prettier to 1.7.0 and nothing happened. What's wrong? Any idea?

@bkw
Copy link

bkw commented Sep 15, 2017

In my case I had a yarn.lock preventing the update. I had to remove it.

@TroublemakerSt
Copy link

My mistake. In the project, there was an old version...

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.

10 participants