Incomplete stack trace when requiring a module that does not return a valid value · Issue #131 · luau-lang/lute · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnnil-- only tables and functions are allowed: https://github.com/aatxe/lute/blob/dfe09d37e45687f4236aaae404809ff2b9abb97f/runtime/src/require.cpp#L176
$ lute one.luau
module must return a table or function
stacktrace:
[C] function require
one.luau:1
^ two.luau:1 should be included in the stack trace
The text was updated successfully, but these errors were encountered:
Required modules run in their own threads in Lute, and there isn't an
easy way to automatically "inherit" a stack trace across a thread
boundary. To make it more user-friendly to debug where an issue is
coming from in required modules, each module thread now stores its stack
trace in its error message in the case of an error, appended to the
actual error message.
---
To demonstrate, I have five Luau files that require each other in a
chain: `a.luau`, `b.luau`, `c.luau`, `d.luau`, and `e.luau`. At the end
of the chain, `e.luau` attempts to (illegally) yield.
Prior to this change, Lute outputted this:
```
module can not yield
stacktrace:
[C] function require
a:1
```
This is what Lute outputs now:
```
module can not yield
[C] function yield
./e:1
[C] function require
./d:1
[C] function require
./c:1
[C] function require
./b:1
stacktrace:
[C] function require
a:1
```
Fixes#131.
one.luau (main file)
two.luau
three.luau
^
two.luau:1
should be included in the stack traceThe text was updated successfully, but these errors were encountered: