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: wrangler still promotes node_compat wrangler flag instead of nodejs_compat runtime flag #6822

Closed
IgorMinar opened this issue Sep 25, 2024 · 1 comment · Fixed by #6824 or #6828
Assignees
Labels
bug Something that isn't working

Comments

@IgorMinar
Copy link
Contributor

Which Cloudflare product(s) does this pertain to?

Wrangler

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

3.78.8

What version of Node are you using?

22

What operating system and version are you using?

Mac

Describe the Bug

Observed behavior

    src/index.ts:1:15:
      1 │ import fs from 'fs';
        ╵                ~~~~

  The package "fs" wasn't found on the file system but is built into node.
  Add "node_compat = true" to your wrangler.toml file and make sure to prefix the module name with "node:" to enable Node.js compatibility.

Expected behavior

Let's promote nodejs_compat & compat date >= 2024-09-23 instead of the legacy node_compat.

Steps to reproduce

wrangler.toml:

name = "quiet-bird-e12a"
main = "src/index.ts"
compatibility_date = "2024-09-23"

src/index.ts

import fs from 'fs';

export default {
	async fetch(request, env, ctx): Promise<Response> {
		return new Response('Hello World!' + fs);
	},
} satisfies ExportedHandler<Env>;

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@IgorMinar IgorMinar added the bug Something that isn't working label Sep 25, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Sep 25, 2024
@IgorMinar
Copy link
Contributor Author

@petebacondarwin while you are at #6821 could you please also fix this one? thank you!

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
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants