KotlinJs: Unable to run jsBrowserTest in Google Cloudbuild due to "ReferenceError: setMetadataFor is not defined"

I am getting the following error when trying to run jsBrowserTest in google cloud run

Task :jsBrowserTest
  Uncaught ReferenceError: setMetadataFor is not defined
  at /tmp/_karma_webpack_217516/commons.js:705:3

The strange thing is that if I run it in almost the same container (the difference is the architecture) locally, it works. It also works locally without a container. It’s a different architecture because locally I am using an M2 Mac.

I can’t find anything on the internet about this and have had no response on the Kotlin slack. Here is a link to my colleagues post on SO: kotlin - KotlinJs: Unable to run jsBrowserTest in Google Cloudbuild due to "ReferenceError: setMetadataFor is not defined" - Stack Overflow

I’m completely stuck and can’t run any JS tests in my CI environment.