Stream: jco

Topic: fetch-failing-in-browser-shim


view this post on Zulip Notification Bot (Dec 23 2024 at 07:52):

A message was moved here from #jco > Basic hello-wasi-http-js sample from ground up by Victor Adossi.

view this post on Zulip Victor Adossi (Dec 23 2024 at 08:20):

Hey @Thomas Wang just moved your issue over to a something new so it's easier for people to find, repro and hopefully help with!

Have you tried without bundling? I'm wondering if esbuild isn't taking in dependencies it should be.

I actually just got your example working, will push up a repo shortly.

view this post on Zulip Victor Adossi (Dec 23 2024 at 08:47):

Hey @Thomas Wang check out this repo for my working example -- I'm not sure exactly what's getting caught up in your Webpack setup, but hopefully it's helpful to you:

https://github.com/vados-cosmonic/jco-browser-fetch-example

PRs welcome to that repo -- I'll try and add it as an official jco example sometime!

Example of using jco with browser-powered fetch(). Contribute to vados-cosmonic/jco-browser-fetch-example development by creating an account on GitHub.
JavaScript toolchain for working with WebAssembly Components - bytecodealliance/jco

view this post on Zulip Victor Adossi (Dec 23 2024 at 08:50):

Oh also, as far as bundling goes, we do have an example over in wasmCloud (a project I'm a maintainer of & whose stewarding corporate entity I currently work for):

https://github.com/wasmCloud/wasmCloud/blob/main/examples/typescript/components/http-password-checker/rollup.config.mjs

Just to be clear -- you do not need to use anything related to wasmCloud there or even glance at the other parts of the example -- I link it here only because it's a good example of a working Rollup config with external NodeJS deps pulled in (we use it to pull in valibot).

There may be other good examples though (maybe I should also commit a similar example to jco!)

wasmCloud is an open source Cloud Native Computing Foundation (CNCF) project that enables teams to build, manage, and scale polyglot apps across any cloud, K8s, or edge. - wasmCloud/wasmCloud

Last updated: Dec 23 2024 at 12:05 UTC