Closed ghoomfrog closed 4 years ago
you have no reference to NavBar in the layout, you need to require it.
@leafo import NavBar from require 'views.navbar'
didn't fix it.
@leafo
import NavBar from require 'views.navbar'
didn't fix it.
I think you should spend some more time looking into how require works, and what import does. At least try some debug print statements to get a better understanding.
Your view file returns a class object, not a table containing a class. import NavBar from require 'views.navbar'
is equivalent to NavBar = (require"views.navbar").NavBar
. This would assign nil
because there is no NavBar
field on the object (the class) that is returned by that module.
Instead you should write: NavBar = require "views.navbar"
@leafo I freaking forgot. The error is the same as in #699 now.
See #699 for the solution.
In #699 I passed the widget's name rather than a function.
p.s. When I passed
NavBar!
instead, the error was the same as in #699.