How to import js file using a relative import?

I've been banging my head against the wall, trying to figure out how to get this code to work. This is the built version, so
manifest_file
could be something else during dev.

wrangler deploy always crashes on this, saying
Uncaught Error: No such module "manifest.js".


the index.js and manifest.js files are in the same directory - as a result of a vite build step. This works fine in the bun and deno runtimes, but having issues with wrangler/cloudflare.
const manifest_file = "./manifest.js";
const { manifest } = await import(manifest_file);
Was this page helpful?