Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Highlighting not working #4345

Closed
Greeenman999 opened this issue Oct 12, 2021 Discussed in #4344 · 11 comments
Closed

Syntax Highlighting not working #4345

Greeenman999 opened this issue Oct 12, 2021 Discussed in #4344 · 11 comments

Comments

@Greeenman999
Copy link

Greeenman999 commented Oct 12, 2021

Discussed in #4344

Originally posted by Greeenman999 October 12, 2021
Web Browser: Google Chrome 94.0.4606.81 (Official Build) (arm64)
Local OS: Mac Os Big Sur 11.3.2
Remote OS: Debian 10
Remote Architecture: amd
code-server --version: 3.12.0 b37ff28

I upgraded code-server and then there was no syntax highlighting anymore.
When I'm accessing directly over the ip adress and port, then its working.
On Firefox it's also working, but on Chrome it doesnt work.

Sometimes this error occures:
Bildschirmfoto_2021-10-12_um_10 27 37
Bildschirmfoto 2021-10-12 um 16 43 52

The complete code is not highlighted and gray:
Bildschirmfoto_2021-10-12_um_10 19 32

Anyone else having this issue?

@oz-orz
Copy link

oz-orz commented Oct 13, 2021

Are you using an extension for syntax highlighting in this language? I am not a maintainer, but AFAIK the most recent update broke some extensions for some people.

@Greeenman999
Copy link
Author

As I said above, on Firefox or when I'm connecting over the ip adress, then it's working, but in Chrome not...

@code-asher
Copy link
Member

The syntax highlighting is done through wasm which looks like is being blocked here. I tried on the same version of Chrome and code-server but was not able to reproduce the issue (I tried Windows and Linux) so I am not sure what the issue is. 🤔

@code-asher code-asher added the needs-investigation This issue needs to be further investigated label Oct 18, 2021
@matthew-st
Copy link

matthew-st commented Dec 21, 2021

ERR WebAssembly.instantiate(): Wasm code generation disallowed by embedder: CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder

I'm getting a similar error. It works over IP (in Chrome) but then other features break too.

It also works perfectly in firefox.

(entirely unrelated to the issue, but the bar at the side displays white instead of the proper background)

@IvanProgramming
Copy link

IvanProgramming commented Jan 19, 2022

Also has a same issue. It worked perfectly in Mobile chrome, but now there is no syntax highlighting in my browser. Connecting over IP don't help, but syntax Highlighting works in Mobile Firefox

@GiantLameChips
Copy link

I am getting this error in MS edge 100.0.1185.50

But when I switch the profile guest mode it works fine must be a setting I changed somewhere in edge

ERR WebAssembly is not defined: ReferenceError: WebAssembly is not defined
    at z (https://example.com/static/node_modules/vscode-oniguruma/release/main.js:1:7821)
    at Object.n [as default] (https://example.com/static/node_modules/vscode-oniguruma/release/main.js:1:6044)
    at https://example.com/static/node_modules/vscode-oniguruma/release/main.js:1:4636
    at Object.n.loadWASM (https://example.com/static/node_modules/vscode-oniguruma/release/main.js:1:4868)
    at k._doGetVSCodeOniguruma (https://example.com/static/out/vs/workbench/workbench.web.main.js:2381:51442)

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 25, 2022

Interesting! 🤔 It says Edge supports WebAssembly here.

Can you try this?

@GiantLameChips
Copy link

Interesting! 🤔 It says Edge supports WebAssembly here.

Can you try this?

thanks that works

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 26, 2022

Hooray! Glad to hear it. I'm going to close this for now.

@jsjoeio jsjoeio closed this as completed Apr 26, 2022
@ij5
Copy link

ij5 commented Jun 5, 2022

I had same problem, but I fixed this issue with changing nginx config files.
You can remove line that contains add_header Content-Security-Policy in nginx.conf.

@leryn1122
Copy link

leryn1122 commented Mar 7, 2023

I had same problem, but I fixed this issue with changing nginx config files. You can remove line that contains add_header Content-Security-Policy in nginx.conf.

@ij5 I don't encourage to remove CSP when using nginx reverse proxy. I added CSP header in nginx configs according to WASM CSP issue. It works on both Chrome v110.* and Edge v110.*

add_header Content-Security-Policy "default-src 'self' 'wasm-unsafe-eval' http: https: ws: wss: data: blob: 'unsafe-inline'; frame-ancestors 'self';" always;

@code-asher code-asher removed the needs-investigation This issue needs to be further investigated label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants