# I have trouble using require() when files are not in the same directory

**URL:** <http://forum.hypr.land/t/i-have-trouble-using-require-when-files-are-not-in-the-same-directory/1636>\
**Category:** Bugs / FRs / Support\
**Tags:** question, help, hyprland, config\
**Created:** [May 25, 2026, 8:16pm UTC](http://forum.hypr.land/t/i-have-trouble-using-require-when-files-are-not-in-the-same-directory/1636 "2026-05-25T20:16:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![beatlesfan](http://forum.hypr.land/letter_avatar_proxy/v4/letter/b/91b2a8/32.png) [@beatlesfan](http://forum.hypr.land/u/beatlesfan)\
**Post date:** [May 25, 2026, 8:16pm UTC](http://forum.hypr.land/t/i-have-trouble-using-require-when-files-are-not-in-the-same-directory/1636/1 "2026-05-25T20:16:13Z")

</div>

Hi,

I am using hyprland 0.55.2.

I know it’s me, I just can’t figure it out. My .lua files are located in `/hypr/config` while hyprland.lua is in `/hypr/` directory. This is what i tried to do according todocs:

`require("config.myfile")`

And it is not working. What am i missing?

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![tekstryder](http://forum.hypr.land/user_avatar/forum.hypr.land/tekstryder/32/258_2.png) [@tekstryder](http://forum.hypr.land/u/tekstryder)\
**Post date:** [May 25, 2026, 8:41pm UTC](http://forum.hypr.land/t/i-have-trouble-using-require-when-files-are-not-in-the-same-directory/1636/2 "2026-05-25T20:41:17Z")

</div>

See GitLab discussion.

- [require lua doesn't work · hyprwm/Hyprland · Discussion #14708 · GitHub](https://github.com/hyprwm/Hyprland/discussions/14708)

I cannot reproduce. Works as expected.

---

<div class="post-metadata">

**Author:** ![beatlesfan](http://forum.hypr.land/letter_avatar_proxy/v4/letter/b/91b2a8/32.png) [@beatlesfan](http://forum.hypr.land/u/beatlesfan)\
**Post date:** [May 25, 2026, 10:20pm UTC](http://forum.hypr.land/t/i-have-trouble-using-require-when-files-are-not-in-the-same-directory/1636/3 "2026-05-25T22:20:55Z")

</div>

Yes, it works now. I am not sure what it was.
