puppetlabs/puppet · error · ArgumentError

The code loaded from %{origin} does not define the TypeSet '

Error message

The code loaded from %{origin} does not define the TypeSet '%{module_name}'

What it means

Error "The code loaded from %{origin} does not define the TypeSet '%{module_name}'" thrown in puppetlabs/puppet.

Source

Thrown at lib/puppet/pops/loader/module_loaders.rb:241

            # Global name must be the name of the module
            unless name_parts[0] == module_name || module_name == NAMESPACE_WILDCARD
              # Check for ruby defined data type in global namespace before giving up
              origin, smart_path = find_existing_path(typed_name)
              return smart_path.is_a?(LoaderPaths::DataTypePath) ? instantiate(smart_path, typed_name, origin) : nil
            end

            # Look for the special 'init_typeset' TypeSet
            origin, smart_path = find_existing_path(init_typeset_name)
            return nil if smart_path.nil?

            value = smart_path.instantiator.create(self, typed_name, origin, get_contents(origin))
            if value.is_a?(Types::PTypeSetType)
              # cache the entry and return it
              return set_entry(typed_name, value, origin)
            end

            # TRANSLATORS 'TypeSet' should not be translated
            raise ArgumentError, _("The code loaded from %{origin} does not define the TypeSet '%{module_name}'") %
                                 { origin: origin, module_name: name_parts[0].capitalize }
          end
        else
          # anything else cannot possibly be in this module
          # TODO: should not be allowed anyway... may have to revisit this decision
          return nil
        end
      end

      # Get the paths that actually exist in this module (they are lazily processed once and cached).
      # The result is an array (that may be empty).
      # Find the file to instantiate, and instantiate the entity if file is found
      origin, smart_path = find_existing_path(typed_name)
      return instantiate(smart_path, typed_name, origin) unless smart_path.nil?

      return nil unless typed_name.type == :type && typed_name.qualified?

      # Search for TypeSet using parent name

View on GitHub (pinned to e227c27540)

When it happens

Trigger: Thrown at lib/puppet/pops/loader/module_loaders.rb:241 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/c5044883b83b1ab5. Report an issue: GitHub.