Giter Club home page Giter Club logo

Comments (12)

jtlehtinen avatar jtlehtinen commented on September 21, 2024 2

@dpurbosakti, are you making file edits from a Windows application. There's a known issue in WSL where modifications made from the native Windows environment may not trigger file modification events in the WSL Linux environment.

A workaround is to use polling by adding the following lines to your Air configuration file:

[build]
  poll = true

from air.

fourstepper avatar fourstepper commented on September 21, 2024

Could you create an example project that shows this issue between two different directories and push it to another repository on Github?

from air.

dpurbosakti avatar dpurbosakti commented on September 21, 2024

@fourstepper https://github.com/dpurbosakti/techschool_simplebank you can check it here
main.go is works fine, but file in the deeper dir isnt working(air doesnt check if file is changed)

from air.

fourstepper avatar fourstepper commented on September 21, 2024

This is caused by you explicitly including "api", I am pretty sure, in your .air.toml - https://github.com/dpurbosakti/techschool_simplebank/blob/main/.air.toml#L14

It works if you comment this line out

from air.

dpurbosakti avatar dpurbosakti commented on September 21, 2024

image
yes i tried to include api dir to try if its work that way,

image
but when i comment "include_dir" in .air.toml its still didnt work even the CLI told me they are watching my dir

image
proof on after edited, no mention about file changed

from air.

dpurbosakti avatar dpurbosakti commented on September 21, 2024

tried in several file in different dir still not working, only detect on main.go file

from air.

fourstepper avatar fourstepper commented on September 21, 2024

With this change, everything works as expected for me.

db/sqlc/account.sql.go has changed
building...
Processing path: /tmp/techschool_simplebank
running...
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /health-check             --> simple-bank/api.NewServer.func1 (3 handlers)
[GIN-debug] POST   /accounts                 --> simple-bank/api.(*Server).createAccount-fm (3 handlers)
[GIN-debug] GET    /accounts/:id             --> simple-bank/api.(*Server).getAccount-fm (3 handlers)
[GIN-debug] GET    /accounts                 --> simple-bank/api.(*Server).listAccounts-fm (3 handlers)
[GIN-debug] PUT    /accounts                 --> simple-bank/api.(*Server).updateAccount-fm (3 handlers)
[GIN-debug] DELETE /accounts/:id             --> simple-bank/api.(*Server).deleteAccount-fm (3 handlers)
[GIN-debug] POST   /transfers                --> simple-bank/api.(*Server).createTransfer-fm (3 handlers)
[GIN-debug] POST   /users                    --> simple-bank/api.(*Server).createUser-fm (3 handlers)
[GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.
Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.
[GIN-debug] Listening and serving HTTP on 0.0.0.0:8080

from air.

dpurbosakti avatar dpurbosakti commented on September 21, 2024

is it maybe because im using WSL ?

from air.

fourstepper avatar fourstepper commented on September 21, 2024

Can't say, try replicating the bug in another environment

from air.

dpurbosakti avatar dpurbosakti commented on September 21, 2024

i've created another repo to check, and it still doesnt work.

from air.

dpurbosakti avatar dpurbosakti commented on September 21, 2024

and yes it works on windows but not in WSL

from air.

dpurbosakti avatar dpurbosakti commented on September 21, 2024

oh nice, it works.
@jtlehtinen thanks

from air.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.