exokitxr / exokit

Native VR/AR/XR engine for JavaScript 🦖

Home Page:https://exokit.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emukit loading throws on baseUrl

avaer opened this issue · comments

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)

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

Hm yes, thanks! Does that change anything?

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 :/

Should be this: 1f2caf3

unhandled rejection: Error while reading zip file.

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

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.

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

it was a fetch() that was pulling that zip

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

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

should we discuss this on discord?