bytecodealliance / ComponentizeJS

JS -> WebAssembly Component
Apache License 2.0
241 stars 32 forks source link

Question - state of fetch in 0.9.0 #119

Closed noise64 closed 4 months ago

noise64 commented 4 months ago

I was following the fetch and related changes in StarlingMonkey and the update PR here, and now that all of them are merged I wanted to test fetch. I saw that during https://github.com/bytecodealliance/ComponentizeJS/pull/111 there was even a test added for it, but it was dropped in a fixup commit (https://github.com/bytecodealliance/ComponentizeJS/pull/111/commits/fea492f976b514b5f5bb539e1c0b3ce387435185) before merging.

Adding it again on top of 0.9.0 results in (formatted a bit by hand for readability):

npm run test -- --grep fetch

> @bytecodealliance/componentize-js@0.9.0 test
> mocha -u tdd test/test.js --timeout 120000 --grep fetch

  Builtins
    1) fetch

  0 passing (2s)
  1 failing

  1) Builtins
       fetch:
     Error: the object {
  "err": "Error: wasm://wasm/027019b2:1

    RuntimeError: unreachable
        at wasm://wasm/027019b2:wasm-function[283]:0x2698bf
        at wasm://wasm/027019b2:wasm-function[626]:0x367920
        at wasm://wasm/027019b2:wasm-function[585]:0x3516bb
        at wasm://wasm/027019b2:wasm-function[56]:0x7c1dd
        at wasm://wasm/027019b2:wasm-function[585]:0x3518c3
        at wasm://wasm/027019b2:wasm-function[4586]:0x651074
        at wasm://wasm/027019b2:wasm-function[2268]:0x541cbd
        at wasm://wasm/027019b2:wasm-function[694]:0x38a455
        at run (wasm://wasm/027019b2:wasm-function[11955]:0x742a9a)
        at run (file:///<...>/ComponentizeJS/test/output/fetch/fetch.js:5555:12)

    Node.js v20.14.0"
  "stderr": <same as err>
  "stdout": ""
} was thrown, throw an Error :)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

If I understand correctly the http feature is enabled by default now.

Is this fetch error expected currently, should fetch work in general? Or was the test case deliberately dropped for now?

guybedford commented 4 months ago

Thanks for posting. Yeah fetch still isn't working for some reason, I'm not sure why. It needs to be traced to determine if it is a StarlingMonkey bug or a ComponentizeJS bug, which also still needs to be investigated further.

For now I'm disabling http by default and leaving it as an option with docs that it's still experimental for the next release.

noise64 commented 4 months ago

Thank you!