Open jvhellemond opened 2 weeks ago
Vento has an NPM distribution. Did you try it?
Yes, but that results in errors like Dynamic require of "node:fs" is not supported
. Cloudflare Workers is a bit like node, but not enough :|
Do you know in which package/file this error occurs?
I don't see any node:fs
in Vento code (npm version). Maybe it's caused by a dependency.
Yup, the dependency is @deno/shim-deno
. The Cloudflare worker environment has no access to the filesystem, so node:fs
is not available.
If Cloudflare has no access to file system, you have to replace the default loader with other with support for Cloudflare API. The default loader is this. You can do something like this:
class CloudflareLoader {
async load(file) {
return {
source: "File content here"
}
}
resolve(from, file) {
return "Resolved file";
}
}
const env = vento({
includes: new CloudflareLoader()
});
Hi, Are there any plans to make Vento compatible with Cloudflare Workers? I tried bundling the npm package (using esbuild), but ran into the dreaded
Dynamic require of "node:fs" is not supported
errors (et al.).I know Vento is specifically a Deno project, but it would be awesome for my projects.