New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require() not working correctly in interactive shell #1824
Comments
Thanks for the report! I'm afraid I'm getting a little stuck on following your reproduction steps (testing on CC 1.110.3, but I don't think this code has change much since).
I'm slightly surprised/confused by this step. I wouldn't expect this to work — if you're running from the root directory, I'd also expect you to hit this problem with the programs in the root directory too. Just to check, you're not changing This is my current setup, with the following files:
Then opening the Lua REPL and running the following: Am I missing/misunderstanding a step here? |
Files are required from the currently running program, so if Alternatively... Updating
|
Thank you for your answer but that makes no sense to me. How are dependencies then handled in the general case? I'd need to go through all dependencies and replace their |
Nevermind. I looked it up and you're right.
In this case you'd always have to import files using dot-notation, but changing the pattern to also transform something like "datatypes/Bidict.lua" into "datatypes." shouldn't be too hard. |
Minecraft Version
1.16.x
Version
1.101.3
Details
require(filePath)
doesn't work correctly with following setup:Set = require("Set")
Bidict = require("Bidict")
While it can find 'Bidict.lua', during its import it tries importing 'Set' inside of 'Bidict.lua' which fails. It can't find the module throwing a stack-trace with all the locations it looked for it. Unfortunately it is cut off so I can't paste it here. The logs also didn't have anything of interest.
Interestingly, starting the interactive shell from the folder containing the two files works fine. My programs in the home directory which import 'Bidict' just like I'm trying to in the shell also work fine.
I hope you can reproduce the bug. Please let me know if I can be of any further assistance!
The text was updated successfully, but these errors were encountered: