I have the context-aware autocompletion beta enabled, and while it was very beneficial in the long term there’s a strange issue where the script analysis would warn me about cyclic module dependency in most of the back-end ModuleScripts I wrote. Most of the modules that the IDE had mentioned do not even recursively call the following target module. The warning at first seemed small and oblivious, but I started to experience a concerning issue where some modules refuse to autocomplete which slowed my workflow, and I discovered that this issue was the source of the problem.
It is unfixable with --!nolint, --!nocheck removes the warning but it removes the benefits of Luau’s type checking system which only further degrades my workflow. The best workaround was wrapping the require function with two parentheses (require)(TARGET_PATH) which not only looks ugly but also ruins require's typechecking.
I’ve misphrased this bug report as the main issue was really just typechecking issues and my code still counts as cyclic module dependency although at that time I didn’t knew what the pattern was about.
The typechecking issue is actually documented on the Luau website, so I think this issue wasn’t particularly fixable:
Could you at least give a reproduceable example of this occurring for engineers to investigate? This warning should only be popping up if you’re requiring another module that requires itself, so if it’s triggering for no reason, you should give an example of it happening.
@WheretIB you mentioned you need a repro in the other thread, don’t want to veer off topic on that thread so I’ll post a repro. It’s obviously a very artificial example but I can post use cases if need be. There are some scripts in the workspace, both modules have the cyclic dependency warning but do not error at runtime.