workers-rs icon indicating copy to clipboard operation
workers-rs copied to clipboard

fix(worker-build): prevent script will never generate a response

Open samdenty opened this issue 2 years ago • 3 comments

This fixes https://github.com/cloudflare/workers-rs/issues/255

There's no clean way to convert the index_bg.js which contains ESM exports, into a function which is called on each fetch().

So in this PR, I basically split the two parts of the bundle up and move the initialization inside the fetch function, by replacing the INSERT_INIT() token

This is kinda hacky, but it works. It fixes the script will never generate a response errors that can occur when sharing the wasm state across requests.

samdenty avatar Dec 31 '22 23:12 samdenty

ping @zebp i wonder if you know who to hit up to get this in, this is blocking me from using worker-rs

samdenty avatar Jan 07 '23 18:01 samdenty

ping @zebp i wonder if you know who to hit up to get this in, this is blocking me from using worker-rs

left a reply in the issue

zebp avatar Jan 07 '23 18:01 zebp

Is there any update on this?

Smephite avatar Mar 02 '23 16:03 Smephite