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

🐛 BUG: Improve node_compat = true warning #6759

Closed
irvinebroque opened this issue Sep 19, 2024 · 0 comments · Fixed by #6781
Closed

🐛 BUG: Improve node_compat = true warning #6759

irvinebroque opened this issue Sep 19, 2024 · 0 comments · Fixed by #6781
Labels
bug Something that isn't working

Comments

@irvinebroque
Copy link
Contributor

irvinebroque commented Sep 19, 2024

Which Cloudflare product(s) does this pertain to?

Wrangler

What version(s) of the tool(s) are you using?

3.78.5

What version of Node are you using?

22.3

What operating system and version are you using?

Mac Sonoma 14.6.1

Describe the Bug

With the following wrangler.toml

name = "node-compat-warning"
main = "src/index.js"
compatibility_date = "2024-09-09"
node_compat = true

And a basic hello world Worker, I see the following error message when I run wrangler dev

▲ [WARNING] Enabling Wrangler compile-time Node.js compatibility polyfill mode for builtins and globals. This is experimental and has serious tradeoffs.

This warning doesn't tell you what you should do instead — to enable nodejs_compat_v2 (soon, nodejs_compat) And I think we have an opportunity to link to these docs from this error:

https://developers.cloudflare.com/workers/runtime-apis/nodejs/

node_compat = true is effectively "old way" and deprecated. We should message as such.

@irvinebroque irvinebroque added the bug Something that isn't working label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant