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 reload not working correctly with devcontainers #631

Open
vitezprchal opened this issue Jul 29, 2024 · 2 comments
Open

Live reload not working correctly with devcontainers #631

vitezprchal opened this issue Jul 29, 2024 · 2 comments

Comments

@vitezprchal
Copy link

Hi there,

Air only watches the directory it is being run in. For instance, when I run air in the /cmd directory, it only watches the /cmd directory and does not detect changes in any other directories or subdirectories.

Steps:

  • Set up a go project with multiple directories (e.g., /cmd, /internal, etc.).
  • Configure a devcontainer in vscode.
  • Run air within one of the subdirectories, such as /cmd.
  • Make changes in other directories or subdirectories.
  • Air does not detect changes outside the /cmd directory.

Environment:

  • Go version: go1.22.5 linux/amd64
  • air version: v1.52.3

I'm using the default configuration provided.
I've also tried enabling proxies.

Is there a known workaround for this issue when using devcontainers?

@LandSprutte
Copy link

Having similar problems on my mac. It rebuild when I save the file, but doesnt refresh in the browser

@rweir
Copy link

rweir commented Sep 10, 2024

Run air within one of the subdirectories, such as /cmd.

can't you just not do that? air should just be run in the root of the project, then you just configure it to ignore things you don't want, for example:

exclude_dir = ["assets", "tmp", "vendor", "testdata"]

you will need to write a config file.

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

3 participants