Genie Discord forum

Author Avatarari.agustiansa
3/13/2023, 9:00:29 AM

I make local module in Genie, and I call those module in Controller File like this: include("MyModule.jl")using .MyModule and the code running well.

But if change code in file MyModule.jl, Controller not running as expected. How to make it work properly?

Author AvatarPere
3/13/2023, 2:38:03 PM

Do you mean, when you make a change to the code in MyModule.jl the changes are not automatically applied to your running code?

Author AvatarPere
3/13/2023, 2:39:35 PM

How are you executing the code in MyModule.jl? is it via Genie or manually? If you're doing it manually, you can use Revise.jl for automatic code reload:

using Revise includet("MyModule.jl"). <--- includet instead of include using .MyModule

changes made to your .jl file will be automatically loaded

Author Avatarari.agustiansa
3/13/2023, 3:25:01 PM

I run using command bin/repl . I already change my code into using Reviseincludet("MyModule").using .MyModule and still getting error

Any other suggestion?

Author AvatarPere
3/13/2023, 3:52:36 PM

can you share your code and the error you're getting?

Author Avatarabhimanyuaryan
3/13/2023, 5:50:19 PM

I replied on Github Discussions

Author Avatarari.agustiansa
3/14/2023, 2:11:39 AM

I replace code include("MyModule.jl")using .MyModule into using MyGenieApp.MyModule and it works... Thank you...