# Uncaught (in promise): "function is not iterable" when using preact inside properties panel

**URL:** <https://forum.bpmn.io/t/uncaught-in-promise-function-is-not-iterable-when-using-preact-inside-properties-panel/11098>\
**Category:** Modeler\
**Created:** [May 29, 2024, 11:30am UTC](https://forum.bpmn.io/t/uncaught-in-promise-function-is-not-iterable-when-using-preact-inside-properties-panel/11098 "2024-05-29T11:30:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![damthor](https://forum.bpmn.io/user_avatar/forum.bpmn.io/damthor/32/5434_2.png) [@damthor](https://forum.bpmn.io/u/damthor)\
**Post date:** [May 29, 2024, 11:30am UTC](https://forum.bpmn.io/t/uncaught-in-promise-function-is-not-iterable-when-using-preact-inside-properties-panel/11098/1 "2024-05-29T11:30:13Z")

</div>

Hi,

I’m using the properties panel along with async extensions that I implemented using the example on github ([bpmn-js-examples/properties-panel-async-extension at main · bpmn-io/bpmn-js-examples · GitHub](https://github.com/bpmn-io/bpmn-js-examples/tree/main/properties-panel-async-extension)). So I have a custom provider that collects all the groups. Inside the groups I use preact hooks for the asynchronous properties.

Example for an async call inside a group (added for call activities):

```auto
export default function (args) {

  const {element} = args;

  const [values, setValues] = useState({});

  useEffect(() => {
    if (!values.diagrams) {
      getDiagrams().then(diagrams => setValues((existing) => { return {...existing, diagrams: diagrams}; }));
    }
  }, [element.id]);

  const {diagrams} = values;

  const entries = [];

  // use diagrams for a select list and add this to entries

  return entries;

```

I used the object syntax in the return value so I can re-use the same data over multiple properties, which worked fine so far.

Now I’ve updated the dependencies of @bpmn-io/properties-panel and  
bpmn-js-properties-panel to the latest version and now I get an error, as soon as I place an element on the canvas that uses this group.

Error message in the console:

```auto
Uncaught (in promise) TypeError: function is not iterable (cannot read property Symbol(Symbol.iterator))
    at b.BpmnPropertiesPanel [as constructor] (index.esm.js:1605:43)

```

That leads to the following part inside bpmn-js-properties-panel:

```auto
// (5) notify layout changes
  const [layoutConfig, setLayoutConfig] = useState(initialLayoutConfig || {});
  const onLayoutChanged = useCallback(newLayout => {
    eventBus.fire('propertiesPanel.layoutChanged', {
      layout: newLayout
    });
  }, [eventBus]);

```

If I’m correct that change came in version 1.21.0, I was below that version before, so that would fit.

I can’t find out, why this error comes up now and even more, why only at this position. I use the same syntax on a property group on process level - so it gets executed directly on loading a diagram, which works fine - and also on other elements, but there dependant on another property which has to be selected first, so this doesn’t get executed directly when adding the object.

So my assumption would be, that it’s some kind of timing issue or that the useEffect calls block each other, but I don’t really see a way around for that here.

Any help or ideas welcome 🙂

---

<div class="post-metadata">

**Author:** ![Martin](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@Martin](https://forum.bpmn.io/u/Martin)\
**Post date:** [May 30, 2024, 2:01pm UTC](https://forum.bpmn.io/t/uncaught-in-promise-function-is-not-iterable-when-using-preact-inside-properties-panel/11098/2 "2024-05-30T14:01:42Z")

</div>

Hi,

Without your specific implementation it is hard for us to reproduce the error. Can you please either share your project or a running example that reproduces the issue you are facing?

Thanks ❤

---

<div class="post-metadata">

**Author:** ![damthor](https://forum.bpmn.io/user_avatar/forum.bpmn.io/damthor/32/5434_2.png) [@damthor](https://forum.bpmn.io/u/damthor)\
**Post date:** [June 3, 2024, 6:52am UTC](https://forum.bpmn.io/t/uncaught-in-promise-function-is-not-iterable-when-using-preact-inside-properties-panel/11098/3 "2024-06-03T06:52:55Z")

</div>

Yes sure, and sorry for the late response.

The project can be found here: [GitHub - flowsforapex/bpmn-modeler at feature/extended-properties](https://github.com/flowsforapex/bpmn-modeler/tree/feature/extended-properties)

Implementation is inside `apexPropertiesProvider/new_provider/parts/callActivity`  
for the useState/useEffect calls and `apexPropertiesProvider/new_provider/plugins/metaDataCollector`  
which will return a dummy result for the async calls for testing purposes.

---

<div class="post-metadata">

**Author:** ![damthor](https://forum.bpmn.io/user_avatar/forum.bpmn.io/damthor/32/5434_2.png) [@damthor](https://forum.bpmn.io/u/damthor)\
**Post date:** [June 11, 2024, 2:16pm UTC](https://forum.bpmn.io/t/uncaught-in-promise-function-is-not-iterable-when-using-preact-inside-properties-panel/11098/4 "2024-06-11T14:16:02Z")

</div>

Still struggeling with this error, I really don’t want to go back to a previous version, where it still worked, because of that ☹

Any help, where to look for a solution, ideas to try out, anything, would be great.

---

<div class="post-metadata">

**Author:** ![barmac](https://forum.bpmn.io/user_avatar/forum.bpmn.io/barmac/32/974_2.png) [@barmac](https://forum.bpmn.io/u/barmac)\
**Post date:** [July 9, 2025, 10:10am UTC](https://forum.bpmn.io/t/uncaught-in-promise-function-is-not-iterable-when-using-preact-inside-properties-panel/11098/5 "2025-07-09T10:10:37Z")

</div>

Closed on July 9, 2025, 10:10am UTC

Closing old topics.
