Prettier extension does not work
See original GitHub issuecode-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
- Start self-hosted code-server (v1.32.0-282) in Ubuntu 18.04.1 LTS in AWS EC2
- Navigate to it from my Mac using Chrome, e.g., https://10.0.x.x:8888/
- Open Extensions tab -> Install Prettier
- Open Chrome Developer Tools -> Console and saw the above errors.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve just repackaged the prettier extension, so in about an hour, it should be good to go.
Found one work-around for this. Install prettier plugin from VS code and run following.
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.