{"record":{"id":"c5044883b83b1ab5","repo":"puppetlabs/puppet","slug":"the-code-loaded-from-origin-does-not-define-the","errorCode":null,"errorMessage":"The code loaded from %{origin} does not define the TypeSet '%{module_name}'","messagePattern":"The code loaded from %(.+?) does not define the TypeSet '%(.+?)'","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/loader/module_loaders.rb","lineNumber":241,"sourceCode":"            # Global name must be the name of the module\n            unless name_parts[0] == module_name || module_name == NAMESPACE_WILDCARD\n              # Check for ruby defined data type in global namespace before giving up\n              origin, smart_path = find_existing_path(typed_name)\n              return smart_path.is_a?(LoaderPaths::DataTypePath) ? instantiate(smart_path, typed_name, origin) : nil\n            end\n\n            # Look for the special 'init_typeset' TypeSet\n            origin, smart_path = find_existing_path(init_typeset_name)\n            return nil if smart_path.nil?\n\n            value = smart_path.instantiator.create(self, typed_name, origin, get_contents(origin))\n            if value.is_a?(Types::PTypeSetType)\n              # cache the entry and return it\n              return set_entry(typed_name, value, origin)\n            end\n\n            # TRANSLATORS 'TypeSet' should not be translated\n            raise ArgumentError, _(\"The code loaded from %{origin} does not define the TypeSet '%{module_name}'\") %\n                                 { origin: origin, module_name: name_parts[0].capitalize }\n          end\n        else\n          # anything else cannot possibly be in this module\n          # TODO: should not be allowed anyway... may have to revisit this decision\n          return nil\n        end\n      end\n\n      # Get the paths that actually exist in this module (they are lazily processed once and cached).\n      # The result is an array (that may be empty).\n      # Find the file to instantiate, and instantiate the entity if file is found\n      origin, smart_path = find_existing_path(typed_name)\n      return instantiate(smart_path, typed_name, origin) unless smart_path.nil?\n\n      return nil unless typed_name.type == :type && typed_name.qualified?\n\n      # Search for TypeSet using parent name","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/loader/module_loaders.rb#L223-L259","documentation":"Error \"The code loaded from %{origin} does not define the TypeSet '%{module_name}'\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/loader/module_loaders.rb:241 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}