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

node:events and more don't work #61

Open
fucksophie opened this issue Mar 25, 2023 · 1 comment
Open

node:events and more don't work #61

fucksophie opened this issue Mar 25, 2023 · 1 comment

Comments

@fucksophie
Copy link

 > node_modules/discord.js/src/client/BaseClient.js:3:29: error: Could not resolve "node:events" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)
    3 │ const EventEmitter = require('node:events');
      ╵                              ~~~~~~~~~~~~~
      ```
@jimrandomh
Copy link

Esbuild (as wrapped by estrella) will try to include all imported libraries in the compiled bundle. Since node:events is a builtin of nodejs which doesn't live in your source code and doesn't live in node_modules, it will fail. The fix is to add node:events to the array you pass in the external option to build, which will exclude it from compilation.

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

2 participants