The thing that broke the build was that ```$itemOptions``` was defined as ```null``` instead of an empty array.