exokitxr / exokit

Native VR/AR/XR engine for JavaScript 🦖
MIT License
997 stars 117 forks source link

Emukit loading throws on baseUrl #1392

Closed avaer closed 5 years ago

avaer commented 5 years ago
unhandled rejection: TypeError [ERR_INVALID_URL]: Invalid URL: inflate.js
    at onParseError (internal/url.js:243:9)
    at new URL (internal/url.js:319:5)
    at Object._normalizeUrl (c:\System\Users\Biatu\Dev\git\exokit\src\utils.js:36:12)
    at _normalizeUrl (c:\System\Users\Biatu\Dev\git\exokit\src\WindowBase.js:245:36)
    at getScript (c:\System\Users\Biatu\Dev\git\exokit\src\WindowBase.js:263:14)
    at importScripts (c:\System\Users\Biatu\Dev\git\exokit\src\WindowBase.js:284:32)
    at doImportScripts (evalmachine.<anonymous>:35:18)
    at evalmachine.<anonymous>:14:5
    at emit (events.js:203:13)
    at MessagePort.<anonymous> (c:\System\Users\Biatu\Dev\git\exokit\src\WindowBase.js:339:16)
BiatuAutMiahn commented 5 years ago

I believe I found a typo in src/request.js@39, req is supposed to be res?

avaer commented 5 years ago

Hm yes, thanks! Does that change anything?

avaer commented 5 years ago

https://github.com/exokitxr/exokit/commit/de46297afe9ba35318fad2ada2d687fcc6a4e6c5

BiatuAutMiahn commented 5 years ago

well I patched emukit/assets/frontend/bundle/js/zip.js@872 to be:

var DEFAULT_WORKER_SCRIPTS = {
    deflater: ['z-worker.js', 'http://127.0.0.1:8000/assets/frontend/bundle/js/deflate.js'],
    inflater: ['z-worker.js', 'http://127.0.0.1:8000/assets/frontend/bundle/js/inflate.js']
};

then that bug appeared.

now im resolving this error:

uncaught exception: ReferenceError: _elementSetter is not defined
    at FileReader.set onload [as onload] (c:\System\Users\Biatu\Dev\git\exokit\src\File.js:14:5)
    at BlobReader.readUint8Array (http://127.0.0.1:8000/assets/frontend/bundle/js/zip.js:212:18)
    at doSeek (http://127.0.0.1:8000/assets/frontend/bundle/js/zip.js:660:12)
    at seekEOCDR (http://127.0.0.1:8000/assets/frontend/bundle/js/zip.js:651:4)
    at Object.getEntries (http://127.0.0.1:8000/assets/frontend/bundle/js/zip.js:678:5)
    at http://127.0.0.1:8000/assets/frontend/bundle/libretro.js:55:21
    at http://127.0.0.1:8000/assets/frontend/bundle/js/zip.js:732:6
    at Worker.onmessage (http://127.0.0.1:8000/assets/frontend/bundle/js/zip.js:941:5)
    at Worker.emit (events.js:203:13)
    at Worker.EventEmitter.emit (domain.js:476:20)
    at WorkerVm.<anonymous> (c:\System\Users\Biatu\Dev\git\exokit\src\WindowBase.js:99:12)
    at WorkerVm.emit (events.js:203:13)
    at WorkerVm.EventEmitter.emit (domain.js:476:20)
    at Worker._message (c:\System\Users\Biatu\Dev\git\exokit\src\WindowVm.js:35:16)
    at Worker.emit (events.js:203:13)
    at Worker.EventEmitter.emit (domain.js:476:20)
    at MessagePort.<anonymous> (internal/worker.js:142:55)
    at MessagePort.emit (events.js:203:13)
    at MessagePort.EventEmitter.emit (domain.js:476:20)
    at MessagePort.onmessage (internal/worker/io.js:70:8)

...trying to figure out how to include util.js in File.js :/

avaer commented 5 years ago

Should be this: https://github.com/exokitxr/exokit/commit/1f2caf354de08dbd89a0c3351b1bd41d688ade8b

BiatuAutMiahn commented 5 years ago

unhandled rejection: Error while reading zip file.

this could be that PS1 bios archive or it's wanting a zipped ROM

avaer commented 5 years ago

That could be one reason, improper handling of gzip.

If that is going through request.js synchronous requests (I'm not sure if it is), it could also be an insufficient buffer here. But if anything other than importScripts is using request.js for synchronous requests that's probably a bigger problem in the use case.

BiatuAutMiahn commented 5 years ago

ok this is turning into new issue, going back to initial issue on emukit.

BiatuAutMiahn commented 5 years ago

it was a fetch() that was pulling that zip

avaer commented 5 years ago

That should be ok, but something could be wrong with the format that's coming out of the fetch Response.

BiatuAutMiahn commented 5 years ago

how can I dump the response? I'll compare to local file

BiatuAutMiahn commented 5 years ago

should we discuss this on discord?