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

[WARNING] The package "node:events" wasn't found on the file system but is built into node #774

Open
connorads opened this issue Mar 23, 2025 · 1 comment

Comments

@connorads
Copy link
Contributor

connorads commented Mar 23, 2025

[WARNING] The package "node:events" wasn't found on the file system but is built into node
Your Worker may throw errors at runtime unless you enable the "nodejs_compat" compatibility flag. 
Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details.

I can see that the warning comes from here where node:events is imported.

import * as events from "node:events";

I haven't actually deployed my actor-core worker to Cloudflare yet but it's complaining locally when I run npm run dev

https://github.com/connorads/actor-core-counter

Haven't really looked into but I'm assuming:

  1. This node dependency was introduced by accident and needs to be removed from actor-core package to avoid this warning for Cloudflare workers
  2. Or, it's expected and the Cloudflare documentation/examples need to add nodejs_compat
  3. Or, this warning from wrangler is incorrect and this node:events thing is fine, wrangler needs updating or some other exception can be made somehow

Might be able to update this issue if/when I deploy something.

Image

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