UnrealEngineHTML5 / Documentation

540 stars 183 forks source link

Uncaught ReferenceError: nullpostData is not defined #133

Open leiloovexiu opened 2 years ago

leiloovexiu commented 2 years ago

Failed to execute 'send' on 'XMLHttpRequest': The provided ArrayBufferView value must not be shared.

I hack-fixed it by changing Engine/Platforms/HTML5/Source/Runtime/HTML5/HTML5JS/Private/HTML5JavaScriptFx.js:

  // HACK: Fixes POST requests when threads are enabled.
  // ORIGINAL: xhr.UE_fetch.postData = Module.HEAP8.subarray(payload, payload + payloadsize);
  var postData = new Uint8Array(payloadsize);
  for (var i = 0; i < payloadsize; ++i) {
    postData[i] = Module.HEAPU8[payload+i];
  }
  xhr.UE_fetch.postData = postData;

After I use it, a new error appears “Uncaught ReferenceError: nullpostData is not defined”

I can't find a solution, can someone help me?