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

# Whenever tried to switch buffer the server breaks down.... #79

Open
Hishantik opened this issue May 20, 2024 · 2 comments
Open

# Whenever tried to switch buffer the server breaks down.... #79

Hishantik opened this issue May 20, 2024 · 2 comments

Comments

@Hishantik
Copy link

whenever tried to switch the html file buffer should have change page on buffer switch...

instead its returns the error :-


ENOENT: no such file or directory, open '/home/hishantik/PracticePoject/webproject/home/hishantik/Practice Project/web project/index.html'


Bracey Error log :


Node.js v20.13.1
starting bracey with arguments:
port: 54304
web-address: 127.0.0.1
editor-address: 127.0.0.1
starting bracey with arguments:
port: 54304
web-address: 127.0.0.1
editor-address: 127.0.0.1
node:events:497
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE: address already in use 127.0.0.1:54304
at Server.setupListenHandle [as _listen2] (node:net:1898:16)
at listenInCluster (node:net:1946:12)
at doListen (node:net:2116:7)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on Server instance at:
at emitErrorNT (node:net:1925:8)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'EADDRINUSE',
errno: -98,
syscall: 'listen',
address: '127.0.0.1',
port: 54304
}

@lifeasawalrus
Copy link

I'm having the same issue. Have you found a solution yet?

@lifeasawalrus
Copy link

lifeasawalrus commented Nov 18, 2024

Here's what ChatGPT gave me. It works well enough now, for me. I will note that since I was switching back and forth between index.html and a file in a subdirectory, index.html could not find its CSS file. In this case, I had to open index.html first, and the other file as a tab, and everything is good so far.

Synchronize Vim's Working Directory

Ensure Vim's cwd is consistent across tabs. You can achieve this by automatically syncing the working directory with the current file's directory:

Add this to your init.lua file:

vim.api.nvim_create_autocmd("BufEnter", { pattern = "*", callback = function() vim.cmd("lcd " .. vim.fn.expand("%:p:h")) end, })

This ensures that the working directory always matches the directory of the currently active buffer.

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

2 participants