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

Live Reloading Not Working #5

Closed
Dosx001 opened this issue Nov 26, 2021 · 18 comments · Fixed by #6 or #30
Closed

Live Reloading Not Working #5

Dosx001 opened this issue Nov 26, 2021 · 18 comments · Fixed by #6 or #30

Comments

@Dosx001
Copy link

Dosx001 commented Nov 26, 2021

Both gh markdown-preview --reload gh markdown-preview -r are not working.

I'm using Ubuntu with WSL, it wasn't working on Firefox on Windows. I opened the Linux version but that didn't work either. I also tried Edge and nothing.

I'm editing my README.md inside Vim. I don't expect live changes but I expected changes everytime I save changes.

@yusukebe
Copy link
Owner

Hey @Dosx001 !

I'd fixed this issue on latest release. Please upgrade gh-markdown-preview with these commands:

gh extension upgrade markdown-preview

Then , live reloading will work!

@yusukebe yusukebe linked a pull request Nov 29, 2021 that will close this issue
@Dosx001
Copy link
Author

Dosx001 commented Nov 29, 2021

@yusukebe thanks for looking at my issue. Unfortunately, the update didn't fix my issue. Like I said don't care about live changes but maybe introduce a new option like gh markdown-preview --save. markdown-preview will refresh the page every time you save changes.

@yusukebe
Copy link
Owner

@Dosx001, Let me get this straight...

Anyway, I have been defined that "live reloading" with --reload option will refresh the page every time README.md is saved. Similar project like Grip, grip command refreshes every time the document is saved. So, there is no problem I think.

Is my understanding correct?

@Dosx001
Copy link
Author

Dosx001 commented Nov 29, 2021

@yusukebe hmmm then maybe it's something with WSL that's causing the problem.

I am on Windows 10 and am using VcXsrv for handling GUI stuff for Linux.

@yusukebe
Copy link
Owner

@Dosx001 OK, I'll check later. Please wait!

@yusukebe
Copy link
Owner

yusukebe commented Dec 1, 2021

Hey @Dosx001

I've tried gh markdown-preview -r with MS Edge and FireFox on macOS. There is no problem. It works well.

I think that the program can't detect file changes on your environment. I want to fix this issue, but Its' difficult to reproduce because I don't have Windows machine :(

@yusukebe
Copy link
Owner

yusukebe commented Dec 1, 2021

@Dosx001 I'm sorry many times.

I tried on Ubuntu, then the problem live reloading is not working is occurred. It might be fixed.

@Dosx001
Copy link
Author

Dosx001 commented Dec 1, 2021

@yusukebe sorry I don't understand your last comment. Is it not working on Ubuntu?

Either way, I tried it on Arch Linux with WSL and it didn't work. So I'm positive it has something to do with WSL. I wish I could help you fix the issue but I don't know Go.

Unfortunately, I did find a vim plugin that does work when using WSL and offers some more robust features. So I will be dropping gh-markdown-preview from my workflow.
https://github.com/iamcco/markdown-preview.nvim

But before I go I think there is another issue you should fix. #7

@yusukebe
Copy link
Owner

yusukebe commented Dec 2, 2021

@Dosx001 Thank you for your comment.

sorry I don't understand your last comment. Is it not working on Ubuntu?

Sorry for the trouble. It works on Ubuntu.

There is one thing that I want to ask you. If you run uname -m command on your Ubuntu and Arch Linux on WSL, what is displayed? Like this:

スクリーンショット 2021-12-02 12 39 35

Please let me know.

@Dosx001
Copy link
Author

Dosx001 commented Dec 2, 2021

@yusukebe both Arch and Ubuntu outputted x86_64

@yusukebe
Copy link
Owner

yusukebe commented Dec 2, 2021

@Dosx001 Oh I see. Thank you!

@bulletmark
Copy link

I'm on current Arch Linux with the current version of gh and this extension. Live reloading does not work. Is there something I am missing, or should this issue be reopened?

@yusukebe
Copy link
Owner

yusukebe commented Apr 7, 2022

Hi @bulletmark

It seems to be a bug. We should reopen this issue.
I'll try to reproduce this issue to fix it.

Thank you!

@yusukebe yusukebe reopened this Apr 7, 2022
@yusukebe
Copy link
Owner

yusukebe commented Apr 8, 2022

I ran this command on my Ubuntu. But, live reloading works well. I can't reproduce this issue.

SS

Can someone show me the screenshot like above in case of live reloading not working?

@bulletmark
Copy link

I run:

$ gh markdown-preview 
2022/04/08 19:57:20 Accepting connections at http://*:3333/
2022/04/08 19:57:20 Open http://*:3333/ on your browser
2022/04/08 19:57:20 GET [200] /
2022/04/08 19:57:21 Watching README.md for changes
2022/04/08 19:57:21 GET [404] /favicon.ico
2022/04/08 19:57:21 GET [200] /__/md

Then it just sits there and never logs anything more (or updates the browser) regardless of how many times I change README.md.

Note, I have not looked at your code but when monitoring for file changes you should not monitor the actual file, rather you should monitor the parent directory and look for changes on that file name. The first approach will not catch the case where an editor changes a file by deletion + creation. The second approach does catch that. I am using vim here so I don't think that is the issue though I remember I got caught by this once on a Mac (with my own software monitor).

@yusukebe
Copy link
Owner

yusukebe commented Apr 9, 2022

@bulletmark
Thank you for your advice.

I found this issue occurs in the situation using Vim. Using Vim, Live Reloading is not working on my Mac.
I'm trying to fix this bug. Please give me a second.

@yusukebe
Copy link
Owner

Hi, @bulletmark

I released v1.2.10 for fixing this issue. Please tell me if it works right on the new version.

@bulletmark
Copy link

bulletmark commented Apr 10, 2022

Yes, seems to have fixed it for me. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants