live-server not reloading browser #4
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/live-server.nvim#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Info
I downloaded live-server for nvim with lazy. also globally with npm. It works when running
LiveServerStart, but saved changes are not reloaded in the browser. I have to manually reload the browser to see the changes.nvim --version: v0.9.4<node-package-manager> --version: nvm 0.38.0live-server --version: 1.2.2Configuration
this is my config located in custom.plugins.lua (I'm using nvchad distro of nvim):
this is what console in browser shows: `Live reload enabled.`Description
Another thing i noticed, is when running LiveServerStop, i got this message:
live-server.nvim: stopped with code 143Even If I don't make any change to the html file, i got that message when running LiveServerStop.
This is my html file if it is important
It was working very well before, I don't know what happened :'/
Two things:
eventfield from the lazy configuration.live-server .yourself and open up the browser on the file you're working on. if that doesn't work, then it is a problem with liver-server and not live-server.nvim. If the file you're working on is indeed the one being rendered in the browser, a failure to update is probably not coming from live-server.Yes sir and thank you for your response and your time. Here you have the specs:
uname -a) :Linux Lenova 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linuxeventfield, but the issue persists.live-server .and everything was working OK even with and without theeventfield in lazy config. (I've been previously trying withlive-serverwithout the '.' and it didn't reload the browser for new changes, the same issue with:LiveServerStart). Even tho, the command:LiveServerStartfor nvim is not working. I will be usinglive-server .in the terminal but I'll be waiting for a response for the issue too so if you need more details I'll be aware :)I just updated the docs on configuring
live-server.nvimwith lazy, so delete the plugin and reinstall with that configuration.Also,
vim.fn.executable('live-server')- this should be 1. If NeoVim can't find live-server then there's something wrongh with your setup.BTW, I just pushed a change that fixes the "live-server stopped with code 143."
I've reinstalled the plugin with the new configurations. I don't use pnpm but I've tried to build the plugin with it without success, so I did it with npm. The live-server stopped message is updated. The issue persists tho.
the output when I do
:echo executable('live-server')is 1.This is the log of Lazy:
Sorry about this bug, it is really confounding. Take for example below, where I start the live-server via
:LiveServerStartthen view the process and see it is running withps aux | grep live-server. So, you are saying if you start live-server via the CLI, the browser reflects changes, but via live-server.nvim, it doesn't?If that's the case, then try to replicate the setup below:

Lastly, the plugin is only about 100 lines long, so debug on your own if you're willing (I should probably add a debug mode myself).
I've recorded my screen so you can see more clearly how the bug is. As you can see, using
:LiveStartServerandlive-serverhave the same bug (I need to reload the browser to see changes). But runninglive-server .works fine.https://github.com/barrett-ruth/live-server.nvim/assets/102400537/b1faf6d3-8999-419b-b4a9-062188e8a902
This is the output of
ps aux | grep live-serverwhen running:LiveStartServerThis is the output when running
live-server .Hope the bug is clearer now.
@SamuelCano03 thanks for the video that is actually helpful.
Can you also run
live-server /home/samuelDesktop/.proyfrom the command line and see if the browser will reload?gracias :D
The same issue, browser doesn't reload.
If it is important, here is the output of ps aux | grep live-server
This is what I see when pressing f12 in browser:
This is the output of the console of the browser:
@barrett-ruth notice that when running
live-serverin CLI, after saving changes , there is noChange detected index.htmlin console (min 0:39). But when runninglive-server ., it does show the change detected message after saving changes (min 1:01)it's because the directory is hidden. I replicated the issue using a hidden
.proydirectory, and the issue went away using a non-hidden directory. I suggest you do not work on major projects using hidden directories - that doesn't seem to make much sense. Otherwise, report the issue with the live-server package directly.I definitely should've caught this issue earlier - sorry for how long this took to debug. Let me know if you have any other comments, but I don't think there's anything on live-server.nvim's end to change.
Thank you very much sorry for the large debug too