When building a new project created using the cloudflare-d1 template I get the error [commonjs--resolver] [plugin vite:resolve] Cannot bundle Node.js built-in "node:async_hooks" imported from "database/context.ts". Consider disabling ssr.noExternal or remove the built-in dependency.
I resolved this by adding external: ["node:async_hooks"], to vite.config.ts, on line 24:
When building a new project created using the
cloudflare-d1
template I get the error[commonjs--resolver] [plugin vite:resolve] Cannot bundle Node.js built-in "node:async_hooks" imported from "database/context.ts". Consider disabling ssr.noExternal or remove the built-in dependency.
I resolved this by adding
external: ["node:async_hooks"],
to vite.config.ts, on line 24: