Start a conversation

Solution Console TypeError When Picklist Attribute Has Undefined Options

Symptom

The Solution Console throws a TypeError when switching between components or expanding detail pages:

TypeError: Cannot read properties of undefined (reading 'forEach')

The error typically occurs repeatedly (once per configuration/attribute) and prevents the detail page from expanding for certain components.

Cause

A picklist attribute in the Solution Definition has no options property defined. The Solution Console iterates over picklist options using .forEach() without null-checking. When the options property is completely missing (undefined) instead of being an empty array ([]), the iteration fails with a TypeError.

This commonly happens when:
- A new picklist attribute is added to a Product Definition but no options are configured
- Solution Definitions differ between environments (e.g., staging has "options": [] while production has no options property at all)

Resolution

Step 1: Identify the failing attribute

Open the browser Developer Tools (F12) and check the Console for the TypeError. Note which component/attribute is referenced in the error stack trace.

Step 2: Check the Solution Definition for the attribute

Compare the Solution Definition data for the failing component between a working environment (e.g., staging) and the failing environment (e.g., production). Look for picklist attributes where the options property is missing entirely.

Step 3: Add empty options to the attribute

Add "options": [] to the picklist attribute in the Solution Definition. This can be done either:

  • Via the plugin: Add the empty options array in the plugin code that defines the attribute
  • Via the Solution Definition: Update the Solution Definition data directly, then clear the cache

Step 4: Clear the cache

After updating the Solution Definition, clear the CloudSense cache to ensure the new definition is picked up:

cssmgnt.API_1.flushCache();

Step 5: Verify the fix

Reload the Solution Console and confirm that switching between components and expanding detail pages works without errors.

Additional Notes

  • The key difference is between "options": [] (empty array, handled correctly) and no options property at all (undefined, causes TypeError)
  • When deploying picklist attributes across environments, always ensure that the options property is present, even if empty
  • This pattern can affect any picklist attribute -- it is not specific to any particular component type
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments