question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR prettier.resolveConfig.sync is not a function

See original GitHub issue

Since the last update 0.39.0 I am getting the following error when trying to format a file:

image

Prettier debug output:

Atom version: 1.20.0
prettier-atom version: 0.39.0
prettier version: 1.7.0
prettier-eslint version: 8.1.0
prettier-atom configuration: {
  "formatOnSaveOptions": {
    "enabled": true,
    "excludedGlobs": [
      "**/*.html"
    ],
    "respectEslintignore": true,
    "showInStatusBar": false,
    "javascriptScopes": [
      "source.js",
      "source.jsx",
      "source.js.jsx",
      "source.babel",
      "source.js-semantic",
      "text.html.basic",
      "text.html.vue"
    ],
    "typescriptScopes": [
      "source.ts",
      "source.tsx",
      "source.ts.tsx"
    ],
    "cssScopes": [
      "source.css",
      "source.less",
      "source.css.less",
      "source.scss",
      "source.css.scss"
    ],
    "jsonScopes": [
      "source.json"
    ],
    "graphQlScopes": [
      "source.graphql"
    ],
    "whitelistedGlobs": [],
    "isDisabledIfNotInPackageJson": false,
    "isDisabledIfNoConfigFile": false
  },
  "prettierOptions": {
    "parser": "flow",
    "semi": false,
    "singleQuote": false,
    "bracketSpacing": true,
    "useTabs": false,
    "jsxBracketSameLine": false,
    "printWidth": 80,
    "tabWidth": "auto",
    "trailingComma": "none"
  },
  "useEslint": true,
  "useEditorConfig": true,
  "prettierEslintOptions": {
    "prettierLast": false
  }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:35

github_iconTop GitHub Comments

7reactions
oltodocommented, Sep 19, 2017

Installing prettier dependency and restarting Atom both worked for me too :

$ yarn add --dev prettier

If it still not works for you, you also can downgrade prettier-atom to 0.38.0 version using apm :

$ apm install prettier-atom@0.38.0

Finish by relaunching your editor.

4reactions
carlos-perucommented, Sep 18, 2017

thanks a lot @BroFox86 yarn add prettier -D indeed solved the issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

"prettierApi.resolveConfig.sync is not a function" error when ...
when running the "Reformat with Prettier" action, the following error occurs: TypeError: prettierApi.resolveConfig.sync is not a function at PrettierPlugin.
Read more >
API · Prettier
The promise will be rejected if there was an error parsing the configuration ... resolveConfig.sync(filePath [, options]) if you'd like to use sync...
Read more >
prettier.resolveConfig JavaScript and Node.js code examples
How to use. resolveConfig. function. in. prettier ... resolveConfig.sync(file, { config: prettierConfigPath, }); try { const fileInfo = prettier.
Read more >
How to use the prettier.resolveConfig function in prettier - Snyk
To help you get started, we've selected a few prettier.resolveConfig examples, based on popular ways it is used in public projects.
Read more >
Prettier - Gitee
Do not look for a configuration file. The default settings will be used. --config-precedence. Defines how config file should be evaluated in combination...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found