prettier-eslint-cli: TypeError: prettier.resolveConfig.sync is not a function

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

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 17
  • Comments: 17 (5 by maintainers)

Most upvoted comments

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 😃

@kentcdodds I don’t think that the resolveConfig.sync is in the published prettier module yet. That landed 7 days ago on master. https://github.com/prettier/prettier/pull/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.

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

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