# Are circular packages supported?

**URL:** <https://discuss.moonbitlang.com/t/are-circular-packages-supported/208>\
**Category:** Development\
**Created:** [April 21, 2024, 4:33pm UTC](https://discuss.moonbitlang.com/t/are-circular-packages-supported/208 "2024-04-21T16:33:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayphelps](https://discuss.moonbitlang.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jayphelps](https://discuss.moonbitlang.com/u/jayphelps)\
**Post date:** [April 21, 2024, 4:33pm UTC](https://discuss.moonbitlang.com/t/are-circular-packages-supported/208/1 "2024-04-21T16:33:30Z")

</div>

The type system seems to accept it in vscode, but when I go to compile it says it can’t find one of them.

---

<div class="post-metadata">

**Author:** ![jayphelps](https://discuss.moonbitlang.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jayphelps](https://discuss.moonbitlang.com/u/jayphelps)\
**Post date:** [April 21, 2024, 7:35pm UTC](https://discuss.moonbitlang.com/t/are-circular-packages-supported/208/2 "2024-04-21T19:35:52Z")

</div>

Ah, nevermind about vscode, it seemed to be working but then when I closed and reopened it I now get the error about it not being found and if I look at the logs for the Moonbit extension I see “error: cyclic dependency detected”. So it seems it’s not supported. I can place things in the same package, but I put them in separate packages because I need to import methods from them and it looks like the current export system doesn’t provide a way for you to specify which method you’re trying to export e.g. you can’t export both `A::new()` and `B::new()` as they’re both just `new`. So I have to use a different unique naming convention. Not a huge deal, but just some feedback that I ran into this.

Feel free to share any tips.

---

<div class="post-metadata">

**Author:** ![peter-jerry-ye](https://discuss.moonbitlang.com/user_avatar/discuss.moonbitlang.com/peter-jerry-ye/32/97_2.png) [@peter-jerry-ye](https://discuss.moonbitlang.com/u/peter-jerry-ye)\
**Post date:** [April 22, 2024, 2:07am UTC](https://discuss.moonbitlang.com/t/are-circular-packages-supported/208/3 "2024-04-22T02:07:48Z")

</div>

Yeah, I think we should give warning for the name conflict @Yu-zh. Maybe we should restrict the exportation to plain functions only?
