Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudflare D1 Template - node:async_hooks error #2

Open
Jbithell opened this issue Nov 23, 2024 · 0 comments
Open

Cloudflare D1 Template - node:async_hooks error #2

Jbithell opened this issue Nov 23, 2024 · 0 comments

Comments

@Jbithell
Copy link

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:

ssr: {
  target: "webworker",
  noExternal: true,
  external: ["node:async_hooks"],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant