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

Browser does not show changes #171

Closed
ghost opened this issue Sep 3, 2019 · 13 comments
Closed

Browser does not show changes #171

ghost opened this issue Sep 3, 2019 · 13 comments

Comments

@ghost
Copy link

ghost commented Sep 3, 2019

Problem summary

Browser no longer updates with changes to the .md file, automatically, after file save (though instant_markdown_slow isn't set) nor after browser refresh. Have to restart nvim to see changes.

Expected

Changes are mirrored instantly to the browser

Environment Information

  • OS: Fedora 30
  • Vim / Neovim version: Neovim 0.3.8
  • Browser: Firefox 68.0.2, Chromium 75.0.3770.100

Attempted to reinstall nvim, vim-plug and instant-markdown-d, clean nvim config.

Provide the debug output (required)

Run cat my_markdown_file.md | instant-markdown-d --mathjax --debug and paste the
console output here:

(node:26333) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
connection established!

Generate log files (required)

let g:instant_markdown_logfile = '/tmp/instant_markdown.log'
  1. Add the above in your ~/.vimrc or ~/.config/nvim/init.vim. Modify the
    path if needed and generate the log file.
  2. Minimal ~/.vimrc or ~/.config/nvim/init.vim where variables for
    vim-instant-markdown defined
  3. debug.html
cat /tmp/instant_markdown.log:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (7) Failed to connect to localhost port 8090: Connection refused
(node:30130) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
connection established!  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

Steps to reproduce the issue (required)

Start with command you used to install instant-markdown-d

  1. npm -g install instant-markdown-d
  2. curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  3. nvim ~/config/nvim/init.vim
  4. Set to
call plug#begin('~/.vim/plugged')
Plug 'suan/vim-instant-markdown', {'for': 'markdown'}
call plug#end()

filetype plugin on

let g:instant_markdown_logfile = '/tmp/instant_markdown.log'
  1. :PlugInstall then quit vim
  2. nvim test.md
  3. Start typing, try saving, Window won't update for anything

Screen shot (if possible)

@HugoPoi
Copy link

HugoPoi commented Sep 14, 2019

I encountered the same issue, all seems good but live update doesn't work.
I have 2 different installs, one in LinuxMint with nodejs 8.x working, and another one in Archlinux with nodejs 12.x which doesn't work. I suspect nodejs but can be another dependency going wrong.

Vim version: 8.1

After digging a little, in the web socket nothing come in the network debugger in messages ( Chromium ).

@HugoPoi
Copy link

HugoPoi commented Sep 14, 2019

Ok digging I think there is change in how nodejs or curl handle tcp socket and buffer, the code that handle the PUT for refreshing is garbadge.

https://github.com/suan/instant-markdown-d/blob/deb41de19fd5945cd0e6af97b79826450754caa7/instant-markdown-d#L205-L209

readAllInput is async because it handle event of data, but res.end close the connection asap in a synchronous manner.

@HugoPoi
Copy link

HugoPoi commented Sep 14, 2019

@Pocochub can you confirm your nodejs version ?

@ghost
Copy link
Author

ghost commented Sep 16, 2019

@Pocochub can you confirm your nodejs version ?

My Node.js version is v12.8.0, I will try tonight on v8.x :)

@ashwinvis
Copy link
Collaborator

Personally I use nodejs-lts-dubnium 10.16.3-1 on ArchLinux

@ashwinvis
Copy link
Collaborator

@Pocochub can you confirm if the fix in instant-markdown/instant-markdown-d#65 works for you?

@ghost
Copy link
Author

ghost commented Oct 22, 2019

@Pocochub can you confirm if the fix in suan/instant-markdown-d#65 works for you?

Working perfectly on Node v12.8.0 😄

@ghost ghost closed this as completed Oct 22, 2019
@haha405pan
Copy link

Hi,

I encountered the same issue on ArchLinux and I tried to switch to Node v12.8.0 but it didn't work ("Firefox browser didn't update with changes to the .md file, automatically").

FYI, my environment information are as follows:

  • NVIM v0.4.4
  • Arch Linux
  • instant-markdown-d works fine with the debug ouptut :
instant-mardown-d version: v0.2.0-rc.2
nodejs version: v14.4.0
Run the following to manually open browser:
    xdg-open http://localhost:8090/

I tested this plugin on my macbook pro with the same init.vim setting and it works fine.

I have checked previous issues but nothing really help. Please give me some hints about this bug. Thanks in advance.

Best regards,
Peter

@ashwinvis
Copy link
Collaborator

@haha405pan Could you try with nodejs-lts-erbium 12.19.0-1 instead?

@HugoPoi
Copy link

HugoPoi commented Nov 12, 2020

@haha405pan It's working with NodeJs last version for me on Archlinux like 15.2.0 ich

@haha405pan
Copy link

@haha405pan Could you try with nodejs-lts-erbium 12.19.0-1 instead?

Thanks for the message, but I don't get any luck with nodejs-lts-erbium 12.19.0-1

@haha405pan
Copy link

@haha405pan It's working with NodeJs last version for me on Archlinux like 15.2.0 ich

Thanks for the message, I also tried the 15.2.0 version but still, the same issue. So I guess the issue is not related to the version of nodejs?

Could you please tell me the steps that get this plugin to work on archlinux? It would be much appreciated! Thanks!

@HugoPoi
Copy link

HugoPoi commented Nov 16, 2020

@haha405pan Nothing special

  1. Follow the Detailed instructions
  2. sudo npm -g install instant-markdown-d

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants