When the $dataColumns variable is null you will get exactly this error:
Uncaught TypeError: implode(): Argument #1 ($pieces) must be of type array, string given
However you don't have ($pieces)!
Same situation for me. Just check your logic to be sure your variable is not null! That worked for me.