prettier-vscode: Getting `Cannot read property 'prettier' of undefined` message

Hi, Everything was working fine but then suddenly I began to receive the error message Cannot read property 'prettier' of undefined when trying to format the code. The only difference I remember is that I updated my VSCode extensions. I uninstalled the extension, reload and the reinstalled again the extension but he problem remains.

I have VSCode 1.11.1 installed on Mac OSX 10.11.6 (El Capitan).

About this issue

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

Most upvoted comments

I’ve seen it, the fix is here #74 As a current workaround, be sure your package.json contains dependencies and devDependencies. They may be empty {}

I got this exact same problem after updating.

EDIT:

I got it to work by adding "prettier": "^1.1.10" to devDependencies and do npm install