Hello @Heinrich Braasch ,
welcome to this moderated Azure community forum.
I have never used the Azure IoT SDK within a WebAssembly environment.
So, I'm not sure how to fix this cross origin challenge within Webassembly.
It seems the app is used for controlling devices via the IoT Hub (hence the direct method invocation).
I propose an alternative.
Do you have a Azure server-side backend?
If so, a solution could be to make a secure call from the webassembly layer to the backend.
In the backend, you invoke the actual call to the IoT Hub via the IoT Hub connection string.
This is also a much more secure solution!
It seems your webassembly has the IoT Hub connection string which is not advised, storing this key outside the cloud.
Is this a solution you could work with?
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.