module 'level' not found

So I have a Codea project that has 3 files, called Main (codea generated), parameter and level. At the beginning of my setup function, I have this:


The first require call doesn’t throw an error in the Output section and seems to work fine, but the second throws an error to the output and seems to halt the script. It says this:

error: [string "-- A little portion of the start of my main file here"]:10: module 'level' not found:
    no field package.preload['level']
    no file './level.lua'
    no file '/usr/local/share/lua/5.1/level.lua

And a bunch of other “no file ‘whatever’” statements. What is wrong with my code? Both the parameter and level files make a table with a function and then have a statement at the bottom to return that table.

@Codea_User - AFAIK, you need to actually bring all that external code into Codea itself, but I’ll let others confirm that. The parameter require may only seem to be working because Codea has a parameter set of its own.

Btw, to format code in your messages, put three ~ on the lines before and after the code. I fixed your message for you.

No, the code is in files made with Codea using the new blank file option, they aren’t in my Dropbox or something like that. They appear as tabs, look on the homepage of for an example of what I am talking about.

@Codea_User - if your code is all in tabs in the Codea editor, then you don’t need any require statements

Oh, that makes a lot more sense. Thamks!