
import Image from "./image.png" and then Wrangler will bundle it for you..wrangler/state/v3/r2 is created containing my files, but are they only accessible through the binding? does wrangler cli run some alternative local server to serve files ?compatibility_flags = ["nodejs_compat"] rather than node_compatnode_compat uses polyfills)fetch, one of the enterprise features is to cache the fetch by a specific cacheKey, although for non-enterprise customers, what is the cache key instead? the URL ? or the request object as a whole?ts-mixer to extend class from 2 different classes, however i am getting the error work.wasm which i am trying to import into my worker, but it keeps failing with "Invalid URL string error"import Image from "./image.png".wrangler/state/v3/r2compatibility_flags = ["nodejs_compat"]node_compatts-mixerUncaught TypeError: Cannot read properties of undefined (reading 'prototype')
at null.<anonymous>work.wasmimport { createHash } from 'node:crypto';
function sha256(text) {
return createHash('sha256').update(text).digest('hex')
}/**
* A class representing a SlashCommandSubcommandBuilder which is a mix of VesperaMixins and DISCORDJSSlashCommandSubcommandBuilder functionalities.
* @mixes VesperaMixins
* @mixes DISCORDJSSlashCommandSubcommandBuilder
*/
@mix(VesperaMixins, DISCORDJSSlashCommandSubcommandBuilder)
export class SlashCommandSubcommandBuilder<T extends unknown> {}async function handleRequest(request) {
const go = new Go();
try {
WebAssembly.instantiateStreaming(fetch("work.wasm"), go.importObject).then((result) => {
go.run(result.instance);
})
if (!instance.exports.handleRequest) {
return new Response("Go function 'handleRequest' not found", { status: 500 });
}
return new Response("Hey!!!", { status: 200 });
} catch (error) {
console.error(error);
return new Response("Error instantiating WebAssembly module", { status: 500 });
}
}