-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Markdown Preview is not working #4421
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
Comments
@benjcabalona1029 you need to enable service workers in order for the markdown preview to work. Are you serving code-server via HTTPS? |
@jsjoeio Thank yor for your comment. How do i enable the service workers? No, I'm not serving it in https. |
There's your issue. You'll need to serve it via HTTPS and that will allow your browser to enable service workers automatically I believe. |
I'm going to close this since this is related to your environment but feel free to open a Discussion if you need more help or have a question about enabling HTTPS. See the docs here for more info. |
Hi @jsjoeio I tried serving it with the I get a new error, ERR [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//"): Error: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
at b (https://benjcabalona-benjcabalona1029.cdr.co/static/b37ff28a0a582aee84a8f961755d0cb40a4081db/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:70:77397)
at new p (https://benjcabalona-benjcabalona1029.cdr.co/static/b37ff28a0a582aee84a8f961755d0cb40a4081db/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:70:78038)
at new m (https://benjcabalona-benjcabalona1029.cdr.co/static/b37ff28a0a582aee84a8f961755d0cb40a4081db/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:70:79686)
at Function.from (https://benjcabalona-benjcabalona1029.cdr.co/static/b37ff28a0a582aee84a8f961755d0cb40a4081db/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:70:79103)
at https://benjcabalona-benjcabalona1029.cdr.co/static/b37ff28a0a582aee84a8f961755d0cb40a4081db/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:1271:14766
at String.replace (<anonymous>)
at _.rewriteVsCodeResourceUrls (https://benjcabalona-benjcabalona1029.cdr.co/static/b37ff28a0a582aee84a8f961755d0cb40a4081db/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:1271:14654)
at _.set html [as html] (https://benjcabalona-benjcabalona1029.cdr.co/static/b37ff28a0a582aee84a8f961755d0cb40a4081db/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:1271:14307)
at https://benjcabalona-benjcabalona1029.cdr.co/static/b37ff28a0a582aee84a8f961755d0cb40a4081db/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:1226:30501
at b.withWebview (https://benjcabalona-benjcabalona1029.cdr.co/static/b37ff28a0a582aee84a8f961755d0cb40a4081db/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:1226:31874) |
Uhh...I have yet to see this error 🤔 @code-asher any ideas? |
Hmm quite odd indeed. The only way I can think of for the authority to
be missing is if the host header is missing but we have used link
successfully before so I am not sure.
There have been changes to the remote authority in the latest code so it
is possible it will be fixed there.
|
Okay, I'll try to update it once we have a new release. Can we reopen this issue? @jsjoeio |
Good call! You got it |
Might be unrelated but I have seen Issues like that while using private/incognito mode. For some odd reasons serverice workers won't start in incognito... Edit: this seems only be true for firefox |
I believe service workers are disabled in incognito in Firefox (IIRC) |
Markdown preview is also not working for me since upgrading to 4.0.1 it seems (from 3.x). I use SSH forwarding, and in the Chrome "Application" tab I see two service workers are green with status "activated and is running." Triggering markdown preview results in no new system logs or console logs, just shows "Activating Extensions..." then nothing happens. Console log
Not sure if related or a new issue. |
When use http://127.0.0.1 or http://localhost code-server's markdown-preview-enhanced preview should worked fine, otherwise use http://ip markdown-preview-enhanced preview is not working. VSCode markdown Plugin: shd101wyy.markdown-preview-enhanced |
Chrome Console:
|
You need to be on HTTPS for it work |
Thanks , but Markdown-preview still can't appear after using https, and the following prompt is 'Activating Extensions...', t @ VM147:1 |
@tlw-ray hmm I'm not sure what that could be. Your error message looks very odd. You're using 4.0.2? Can you try clearing your cache maybe? It's working for me. |
@jsjoeio, hi, I'm finding the cause of the problem. case1: Start code-server-4.0.2 with out cert. (I only using this version server) When accessing the server via Accssing via
case2: Start with cert and cert-key, and let explorer trust the self cert ROOTCA(https no warning in explorer). Access via
|
Although 4.0.2 fixed some http / https related issues for me it did not fix Markdown preview via http (and hostname). |
Ah maybe I'm slow, but what am I looking at here?
That looks like #4773 which should be fixed in 4.0.3 |
Great~ |
Still not works for me |
@Cleanairdreaming are you using HTTPS? |
Hi @jsjoeio , code-server: v4.3.0 |
Can you deploy it to HTTPS? I believe many services offer this for free. Other than that, there isn't much we can do since this is a browser limitation |
Maybe #5338 is related? |
I deployed it in HTTPS and it works as expected. Thanks @jsjoeio |
awesome! i'm going to close this for now then. |
You can config https, it's easy: https://coder.com/docs/code-server/latest/guide#using-lets-encrypt-with-caddy |
Is it just not planned to allow code server to work properly with the certificates it creates when started with ’--cert’? |
@jsjoeio It worked, when I add |
The certs are being created with mkcert i wonder if chrome starts to work if you install mkcert on your host system? |
By working properly do we mean Chrome is not letting you accept the self-signed certificate? When I try I get "your connection is not private" (as expected) then I can accept the certificate anyway by going to advanced > proceed on the page. |
When i do "advanced.../proceed..." i still get webview errors and most cool features don't work as expected :-/ |
Ohhhhh right I remember now that Chrome started rejecting the certificate for service workers even if you accept the certificate on that page. I am not sure if there is anything we can do from code-server's side on this unfortunately. I think this is just a decision they made on the browser side so we are kinda stuck with it. It might be wise to output some text when using Although personally to me it feels like a bug so maybe there is something upstream about it. |
Interestingly Firefox does seem to work. |
Issue is similar to #296 The fix in this issue is not applicable to me I think since I'm not running behind nginx.
Steps to Reproduce
md
file.Nothing in the code-server logs, But on dev tools,
I'm not accesing it in incognito mode.
The text was updated successfully, but these errors were encountered: