cantonic
cantonic

Reputation: 1033

"Uninitialized constant" errors in Hyperstack: models and components cannot be found

This is a weird error, because everything worked fine last week. When I wanted to start the app in development mode today I got multiple "Name Errors" saying that some classes cannot be found.

I have a component file called 'index.rb' with following content:

class Index < HyperComponent
  render do
    TABLE do
      THEAD do
        TR do
          TD { "ID" }
          # some other TD elements
        end
      end
      TBODY do
        SearchRequest.each do |search_request|
          SearchRequestItem(search_request: search_request)
        end
      end
    end
  end
end

Now I suddenly get this error message: uninitialized constant Index::SearchRequest. SearchRequest is a model. There is no component Index::SearchRequest. It worked last week, but suddenly this came up.

Any ideas? :)

Thanks in advance

Update: The first error message I see in the console is:

Uncaught $NameError
message: "wrong constant name configuration"
stack: "wrong constant name configuration↵    at module_constructor.TMP_Opal_const_name$B_13 [as $const_name!] (http://0.0.0.0:5000/assets/corelib/helpers.self-12819e26a0290805599453b792fbf0f79a851b1f41aec5b8b47882438d7488a6.js?body=1:153:14)↵    at singleton_class_alloc.TMP_Module_const_defined$q_25 [as $const_defined?] (http://0.0.0.0:5000/assets/corelib/module.self-5472617930a9290fbc25a43d92197430a9f2f23359e95519f0448e3c43a41193.js?body=1:371:71)↵    at singleton_class_alloc.$$method_missing [as $method_missing] (http://0.0.0.0:5000/assets/hyperstack/component/native_library.self-75535a84993c140838a291f5280afa5c8027bc47f30991308163acb8bf6b7159.js?body=1:83:48)↵    at singleton_class_alloc.method_missing_stub [as $configuration] (http://0.0.0.0:5000/assets/corelib/runtime.self-a59b72816f596f5bb11f5da568edd0b684eec56ddaff0ae5da9834528996763d.js?body=1:1197:35)↵    at Opal.modules.models/application_record (http://0.0.0.0:5000/assets/models/application_record.self-58a416171d848eb64cec39146f35ea6fe61a97c774407ec8af7b6152798886ee.js?body=1:10:133)↵    at Object.Opal.load (http://0.0.0.0:5000/assets/corelib/runtime.self-a59b72816f596f5bb11f5da568edd0b684eec56ddaff0ae5da9834528996763d.js?body=1:2192:7)↵    at Object_alloc.Opal.require [as $require] (http://0.0.0.0:5000/assets/corelib/runtime.self-a59b72816f596f5bb11f5da568edd0b684eec56ddaff0ae5da9834528996763d.js?body=1:2216:17)↵    at Opal.modules.hyperstack-loader-application (http://0.0.0.0:5000/assets/hyperstack-loader-application.self-382c06b870470bd068dbf8a33536e9fdd371413f8b450880cf33e931fafc530c.js?body=1:22:8)↵    at Object.Opal.load (http://0.0.0.0:5000/assets/corelib/runtime.self-a59b72816f596f5bb11f5da568edd0b684eec56ddaff0ae5da9834528996763d.js?body=1:2192:7)↵    at http://0.0.0.0:5000/assets/hyperstack-loader.self-55b4fc5e1a9419c2c6574d3d23240bc19ca6c327d2bc43f3d74afaf673c5da68.js?body=1:5:6"

Also I see several errors after the above one like those:

HyperStack autoloader failed attempting to load Object::ApplicationRecord.  Could be a bug in autoloader

HyperStack autoloader failed attempting to load Object::SearchRequest.  Could be a bug in autoloader

HyperStack autoloader failed attempting to load Object::ApplicationRecord.  Could be a bug in autoloader

HyperStack autoloader failed attempting to load Object::User.  Could be a bug in autoloader

HyperStack autoloader failed attempting to load Object::SearchRequest.  Could be a bug in autoloader

Uncaught $NameErrormessage: "uninitialized constant SearchRequestForm::SearchRequest"name: "SearchRequest"stack: "SearchRequest: uninitialized constant SearchRequestForm::SearchRequest"

HyperStack autoloader failed attempting to load Object::SearchRequest.  Could be a bug in autoloader

Upvotes: 0

Views: 45

Answers (0)

Related Questions