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.

Prettier extension does not work

See original GitHub issue
  • code-server version: v1.32.0-282
  • OS Version: Ubuntu 18.04.1 LTS in AWS EC2

Description

After installing the Prettier extension, it is not loaded according to VS Code -> Output panel

Found following errors in the Chrome Deverloper Tools -> Console:

VM5645 webview-pre.js:378 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-lI7FtpaE7cBnMCxYJFcftk1y+Kd3aGDm9OKs5qP5uf4='), or a nonce ('nonce-...') is required to enable inline execution.

webview-pre.js:378 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-lI7FtpaE7cBnMCxYJFcftk1y+Kd3aGDm9OKs5qP5uf4='), or a nonce ('nonce-...') is required to enable inline execution.

cb2232.bundle.js:60 Activating extension 'esbenp.prettier-vscode' failed: Cannot find module 'prettier'.

cb2232.bundle.js:45 [Extension Host] Activating extension 'esbenp.prettier-vscode' failed: Cannot find module 'prettier'. (at Object.showMessage (eval at exports.requireModule (/usr/local/bin/code-server:468:27660), <anonymous>:177866:37))

cb2232.bundle.js:45 [Extension Host] Activating extension `esbenp.prettier-vscode` failed:  Cannot find module 'prettier' (at newlyActivatingExtension._host.actualActivateExtension.then (eval at exports.requireModule (/usr/local/bin/code-server:468:27660), <anonymous>:177722:25))

Steps to Reproduce

  1. Start self-hosted code-server (v1.32.0-282) in Ubuntu 18.04.1 LTS in AWS EC2
  2. Navigate to it from my Mac using Chrome, e.g., https://10.0.x.x:8888/
  3. Open Extensions tab -> Install Prettier
  4. Open Chrome Developer Tools -> Console and saw the above errors.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
foresthoffmancommented, Mar 26, 2019

I’ve just repackaged the prettier extension, so in about an hour, it should be good to go.

1reaction
AriPerkkiocommented, Apr 5, 2019

Found one work-around for this. Install prettier plugin from VS code and run following.

cd ~/.local/share/code-server/extensions/esbenp.prettier-vscode-1.8.1
npm install

For some reason npm install is not ran when prettier is installed from VSCode. This resolved my issue on debian with code-server 1.408-vsc1.32.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does Prettier not format code in VS Code? - Stack Overflow
Click on Preferences: Open Settings (JSON) from the suggestion dropdown. Inside the settings.json file, Check if "[html]" key exists. If the key ...
Read more >
Prettier not working in VSCode – possible fixes - LinuxPip
Set Prettier as Default Formatter. VSCode have a huge ecosystem of extensions, which includes numerous formatters for multiple different ...
Read more >
Prettier stopped working in VS Code - DeveloperF1.com
Open settings by pressing CTRL + , or using the menu item File -> Preferences -> Settings · Type default formatter into the...
Read more >
Format on Save (prettier) stopped working with latest update
Same thing happened to me just now. I set prettier as the Default Formatter in Settings and it started working again. My Default...
Read more >
Configuration File - Prettier
Prettier intentionally doesn't support any kind of global configuration. This is to make sure that when a project is copied to another computer,...
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