Repository: cloudflare/workers-sdk
Pull request #8666: Remove `NodeJSCompatModule`
Author: login: penalosa
Labels: name: e2e
description: Run wrangler + vite-plugin e2e tests on a PR
Created: 2025-03-25T17:26:36Z | Merged: 2025-03-27T12:31:39Z

Fixes n/a

This will soon be removed in `workerd`, and was never fully supported for deployed Workers. As such, it's being entirely removed.

---

<!--
Please don't delete the checkboxes <3
The following selections do not need to be completed if this PR only contains changes to .md files
-->

- Tests
  - [ ] TODO (before merge)
  - [ ] Tests included
  - [x] Tests not necessary because: This passes the existing tests (with some modifications), which should be sufficient
- Wrangler E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
  - [ ] I don't know
  - [x] Required
  - [ ] Not required because:
- Public documentation
  - [ ] TODO (before merge)
  - [ ] Cloudflare docs PR(s): <!--e.g. <https://github.com/cloudflare/cloudflare-docs/pull/>...-->
  - [x] Documentation not necessary because: never exposed to users
- Wrangler V3 Backport
  - [ ] TODO (before merge)
  - [x] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/8683
  - [ ] Not necessary because:

<!--
Have you read our [Contributing guide](https://github.com/cloudflare/workers-sdk/blob/main/CONTRIBUTING.md)?
In particular, for non-trivial changes, please always engage on the issue or create a discussion or feature request issue first before writing your code.
-->



Diff:
diff --git a/.changeset/violet-ravens-draw.md b/.changeset/violet-ravens-draw.md
new file mode 100644
index 0000000000..744925e302
--- /dev/null
+++ b/.changeset/violet-ravens-draw.md
@@ -0,0 +1,7 @@
+---
+"miniflare": patch
+"@cloudflare/vitest-pool-workers": patch
+"wrangler": patch
+---
+
+Remove `NodeJSCompatModule`. This was never fully supported, and never worked for deploying Workers from Wrangler.
diff --git a/packages/miniflare/src/plugins/core/modules.ts b/packages/miniflare/src/plugins/core/modules.ts
index 669dc84489..9b1565ec2d 100644
--- a/packages/miniflare/src/plugins/core/modules.ts
+++ b/packages/miniflare/src/plugins/core/modules.ts
@@ -21,7 +21,7 @@ const SUGGEST_NODE =
 	"that uses Node.js built-ins, you'll either need to:" +
 	"\n- Bundle your Worker, configuring your bundler to polyfill Node.js built-ins" +
 	"\n- Configure your bundler to load Workers-compatible builds by changing the main fields/conditions" +
-	"\n- Enable the `nodejs_compat` compatibility flag and use the `NodeJsCompatModule` module type" +
+	"\n- Enable the `nodejs_compat` compatibility flag" +
 	"\n- Find an alternative package that doesn't require Node.js built-ins";
 
 const builtinModulesWithPrefix = builtinModules.concat(
@@ -43,7 +43,6 @@ export function maybeGetStringScriptPathIndex(
 export const ModuleRuleTypeSchema = z.enum([
 	"ESModule",
 	"CommonJS",
-	"NodeJsCompatModule",
 	"Text",
 	"Data",
 	"CompiledWasm",
@@ -52,7 +51,7 @@ export const ModuleRuleTypeSchema = z.enum([
 ]);
 export type ModuleRuleType = z.infer<typeof ModuleRuleTypeSchema>;
 
-type JavaScriptModuleRuleType = "ESModule" | "CommonJS" | "NodeJsCompatModule";
+type JavaScriptModuleRuleType = "ESModule" | "CommonJS";
 
 export const ModuleRuleSchema = z.object({
 	type: ModuleRuleTypeSchema,
@@ -291,7 +290,6 @@ ${dim(modulesConfig)}`;
 		}
 		const spec = specExpression.value;
 
-		const isNodeJsCompatModule = referencingType === "NodeJsCompatModule";
 		if (
 			// `cloudflare:` and `workerd:` imports don't need to be included explicitly
 			spec.startsWith("cloudflare:") ||
@@ -299,7 +297,7 @@ ${dim(modulesConfig)}`;
 			// Node.js compat v1 requires imports to be prefixed with `node:`
 			(this.#nodejsCompatMode === "v1" && spec.startsWith("node:")) ||
 			// Node.js compat modules and v2 can also handle non-prefixed imports
-			((this.#nodejsCompatMode === "v2" || isNodeJsCompatModule) &&
+			(this.#nodejsCompatMode === "v2" &&
 				builtinModulesWithPrefix.includes(spec)) ||
 			// Async Local Storage mode (node_als) only deals with `node:async_hooks` imports
 			(this.#nodejsCompatMode === "als" && spec === "node:async_hooks") ||
@@ -345,7 +343,6 @@ ${dim(modulesConfig)}`;
 		switch (rule.type) {
 			case "ESModule":
 			case "CommonJS":
-			case "NodeJsCompatModule":
 				const code = data.toString("utf8");
 				this.#visitJavaScriptModule(code, identifier, rule.type);
 				break;
@@ -383,8 +380,6 @@ function createJavaScriptModule(
 		return { name, esModule: code };
 	} else if (type === "CommonJS") {
 		return { name, commonJsModule: code };
-	} else if (type === "NodeJsCompatModule") {
-		return { name, nodeJsCompatModule: code };
 	}
 	// noinspection UnnecessaryLocalVariableJS
 	const exhaustive: never = type;
@@ -409,7 +404,6 @@ export function convertModuleDefinition(
 	switch (def.type) {
 		case "ESModule":
 		case "CommonJS":
-		case "NodeJsCompatModule":
 			return createJavaScriptModule(
 				contentsToString(contents),
 				name,
@@ -441,8 +435,6 @@ function convertWorkerModule(mod: Worker_Module): ModuleDefinition {
 
 	if ("esModule" in m) return { path, type: "ESModule" };
 	else if ("commonJsModule" in m) return { path, type: "CommonJS" };
-	else if ("nodeJsCompatModule" in m)
-		return { path, type: "NodeJsCompatModule" };
 	else if ("text" in m) return { path, type: "Text" };
 	else if ("data" in m) return { path, type: "Data" };
 	else if ("wasm" in m) return { path, type: "CompiledWasm" };
diff --git a/packages/miniflare/src/runtime/config/workerd.ts b/packages/miniflare/src/runtime/config/workerd.ts
index fc7d8331fe..fa35332eac 100644
--- a/packages/miniflare/src/runtime/config/workerd.ts
+++ b/packages/miniflare/src/runtime/config/workerd.ts
@@ -78,7 +78,6 @@ export type Worker_Module = {
 	| { data?: Uint8Array }
 	| { wasm?: Uint8Array }
 	| { json?: string }
-	| { nodeJsCompatModule?: string }
 	| { pythonModule?: string }
 	| { pythonRequirement?: string }
 );
diff --git a/packages/miniflare/test/fixtures/modules/index.node.cjs b/packages/miniflare/test/fixtures/modules/index.node.cjs
index f9c00c4d45..b952641e96 100644
--- a/packages/miniflare/test/fixtures/modules/index.node.cjs
+++ b/packages/miniflare/test/fixtures/modules/index.node.cjs
@@ -3,7 +3,7 @@ const assert = require("assert");
 // Test `require()` of Node built-in module with prefix
 const assert2 = require("node:assert");
 
-// `Buffer` should be global in `NodeJsCompatModule`s
+// `Buffer` should be global in `CommonJS`s with node_compat_v2 turned on
 assert.strictEqual(typeof Buffer, "function");
 assert2(true);
 
diff --git a/packages/miniflare/test/plugins/core/modules.spec.ts b/packages/miniflare/test/plugins/core/modules.spec.ts
index be8bae417c..63ced74cca 100644
--- a/packages/miniflare/test/plugins/core/modules.spec.ts
+++ b/packages/miniflare/test/plugins/core/modules.spec.ts
@@ -20,7 +20,7 @@ test("Miniflare: accepts manually defined modules", async (t) => {
 	// Check with just `path`
 	const mf = new Miniflare({
 		compatibilityDate: "2023-08-01",
-		compatibilityFlags: ["nodejs_compat"],
+		compatibilityFlags: ["nodejs_compat_v2"],
 		// TODO(soon): remove `modulesRoot` once https://github.com/cloudflare/workerd/issues/1101 fixed
 		//  and add separate test for that
 		modulesRoot: ROOT,
@@ -29,7 +29,7 @@ test("Miniflare: accepts manually defined modules", async (t) => {
 			{ type: "ESModule", path: path.join(ROOT, "blobs.mjs") },
 			{ type: "ESModule", path: path.join(ROOT, "blobs-indirect.mjs") },
 			{ type: "CommonJS", path: path.join(ROOT, "index.cjs") },
-			{ type: "NodeJsCompatModule", path: path.join(ROOT, "index.node.cjs") },
+			{ type: "CommonJS", path: path.join(ROOT, "index.node.cjs") },
 			// Testing modules in subdirectories
 			{ type: "Text", path: path.join(ROOT, "blobs", "text.txt") },
 			{ type: "Data", path: path.join(ROOT, "blobs", "data.bin") },
@@ -51,7 +51,7 @@ test("Miniflare: accepts manually defined modules", async (t) => {
 		"AGFzbQEAAAABBwFgAn9/AX8DAgEABwcBA2FkZAAACgkBBwAgACABawsACgRuYW1lAgMBAAA=";
 	await mf.setOptions({
 		compatibilityDate: "2023-08-01",
-		compatibilityFlags: ["nodejs_compat"],
+		compatibilityFlags: ["nodejs_compat_v2"],
 		modules: [
 			{ type: "ESModule", path: path.join(ROOT, "index.mjs") },
 			{
@@ -79,7 +79,7 @@ test("Miniflare: accepts manually defined modules", async (t) => {
         `,
 			},
 			{
-				type: "NodeJsCompatModule",
+				type: "CommonJS",
 				path: path.join(ROOT, "index.node.cjs"),
 				contents: `module.exports = "node:";`,
 			},
@@ -112,14 +112,14 @@ test("Miniflare: automatically collects modules", async (t) => {
 		modules: true,
 		modulesRoot: ROOT,
 		modulesRules: [
-			// Implicitly testing default module rules for `ESModule` and `CommonJS`
-			{ type: "NodeJsCompatModule", include: ["**/*.node.cjs"] },
+			// Implicitly testing default module rules for `ESModule`
+			{ type: "CommonJS", include: ["**/*.node.cjs", "**/*.cjs"] },
 			{ type: "Text", include: ["**/*.txt"] },
 			{ type: "Data", include: ["**/*.bin"] },
 			{ type: "CompiledWasm", include: ["**/*.wasm"] },
 		],
 		compatibilityDate: "2023-08-01",
-		compatibilityFlags: ["nodejs_compat"],
+		compatibilityFlags: ["nodejs_compat_v2"],
 		scriptPath: path.join(ROOT, "index.mjs"),
 	});
 	t.teardown(() => mf.dispose());
@@ -206,14 +206,14 @@ test("Miniflare: cannot automatically collect modules from dynamic import expres
 		modules: true,
 		modulesRoot: ROOT,
 		modulesRules: [
-			// Implicitly testing default module rules for `ESModule` and `CommonJS`
-			{ type: "NodeJsCompatModule", include: ["**/*.node.cjs"] },
+			// Implicitly testing default module rules for `ESModule`
+			{ type: "CommonJS", include: ["**/*.node.cjs", "**/*.cjs"] },
 			{ type: "Text", include: ["**/*.txt"] },
 			{ type: "Data", include: ["**/*.bin"] },
 			{ type: "CompiledWasm", include: ["**/*.wasm"] },
 		],
 		compatibilityDate: "2023-08-01",
-		compatibilityFlags: ["nodejs_compat"],
+		compatibilityFlags: ["nodejs_compat_v2"],
 		scriptPath,
 	});
 
@@ -233,7 +233,7 @@ You must manually define your modules when constructing Miniflare:
     modules: [
       { type: "ESModule", path: "index-dynamic.mjs" },
       { type: "CommonJS", path: "index.cjs" },
-      { type: "NodeJsCompatModule", path: "index.node.cjs" },
+      { type: "CommonJS", path: "index.node.cjs" },
       { type: "ESModule", path: "blobs-indirect.mjs" },
       { type: "ESModule", path: "blobs.mjs" },
       { type: "Text", path: "blobs/text.txt" },
diff --git a/packages/vitest-pool-workers/src/pool/index.ts b/packages/vitest-pool-workers/src/pool/index.ts
index 32dfdf0197..941cdeedf4 100644
--- a/packages/vitest-pool-workers/src/pool/index.ts
+++ b/packages/vitest-pool-workers/src/pool/index.ts
@@ -372,11 +372,8 @@ function buildProjectWorkerOptions(
 		runnerWorker.compatibilityFlags
 	);
 
-	if (mode !== "v1" && mode !== "v2") {
-		runnerWorker.compatibilityFlags.push(
-			"nodejs_compat",
-			"no_nodejs_compat_v2"
-		);
+	if (mode !== "v2") {
+		runnerWorker.compatibilityFlags.push("nodejs_compat_v2");
 	}
 
 	// Required for `workerd:unsafe` module. We don't require this flag to be set
diff --git a/packages/vitest-pool-workers/src/pool/module-fallback.ts b/packages/vitest-pool-workers/src/pool/module-fallback.ts
index 9ac60ed009..b037ad8377 100644
--- a/packages/vitest-pool-workers/src/pool/module-fallback.ts
+++ b/packages/vitest-pool-workers/src/pool/module-fallback.ts
@@ -409,8 +409,6 @@ function maybeGetForceTypeModuleContents(
 			return { esModule: contents.toString() };
 		case "CommonJS":
 			return { commonJsModule: contents.toString() };
-		case "NodeJsCompatModule":
-			return { nodeJsCompatModule: contents.toString() };
 		case "Text":
 			return { text: contents.toString() };
 		case "Data":
@@ -510,8 +508,8 @@ async function load(
 	// Respond with CommonJS module
 
 	// If we're `import`ing a CommonJS module, or we're `require`ing a `node:*`
-	// module from a NodeJsCompatModule, return an ES module shim. Note
-	// NodeJsCompatModules can `require` ES modules, using the default export.
+	// module from a CommonJS, return an ES module shim. Note
+	// CommonJS can `require` ES modules, using the default export.
 	const insertCjsEsmShim = method === "import" || specifier.startsWith("node:");
 	if (insertCjsEsmShim && !disableCjsEsmShim) {
 		const fileName = posixPath.basename(filePath);
@@ -526,9 +524,9 @@ async function load(
 	}
 
 	// Otherwise, if we're `require`ing a non-`node:*` module, just return a
-	// NodeJsCompatModule
+	// CommonJS
 	debuglog(logBase, "cjs:", filePath);
-	return buildModuleResponse(target, { nodeJsCompatModule: contents });
+	return buildModuleResponse(target, { commonJsModule: contents });
 }
 
 export async function handleModuleFallbackRequest(
diff --git a/packages/wrangler/src/__tests__/api/startDevWorker/LocalRuntimeController.test.ts b/packages/wrangler/src/__tests__/api/startDevWorker/LocalRuntimeController.test.ts
index d9735954a1..26543ce992 100644
--- a/packages/wrangler/src/__tests__/api/startDevWorker/LocalRuntimeController.test.ts
+++ b/packages/wrangler/src/__tests__/api/startDevWorker/LocalRuntimeController.test.ts
@@ -149,7 +149,7 @@ describe("LocalRuntimeController", () => {
 			const config = {
 				name: "worker",
 				entrypoint: "NOT_REAL",
-				compatibilityFlags: ["nodejs_compat"],
+				compatibilityFlags: ["nodejs_compat_v2"],
 				compatibilityDate: "2023-10-01",
 			};
 			const bundle: Bundle = {
@@ -171,7 +171,7 @@ describe("LocalRuntimeController", () => {
 					`,
 					},
 					{
-						type: "nodejs-compat-module",
+						type: "commonjs",
 						name: "base64.cjs",
 						filePath: "/virtual/node/base64.cjs",
 						content: `module.exports = {
@@ -223,7 +223,7 @@ describe("LocalRuntimeController", () => {
 							});
 						} else if (pathname === "/throw-commonjs") {
 							try { add.throw(); } catch (e) { return new Response(e.stack); }
-						} else if (pathname === "/throw-nodejs-compat-module") {
+						} else if (pathname === "/throw-other-commonjs") {
 							try { base64.throw(); } catch (e) { return new Response(e.stack); }
 						} else {
 							return new Response(null, { status: 404 });
@@ -270,12 +270,12 @@ describe("LocalRuntimeController", () => {
 			    at Object.fetch (file:///D:/virtual/esm/index.mjs:15:19)"
 			`);
 
-				// Check stack traces from NodeJsCompatModule modules include file path
-				res = await fetch(new URL("/throw-nodejs-compat-module", url));
+				// Check stack traces from CommonJS modules include file path
+				res = await fetch(new URL("/throw-other-commonjs", url));
 				expect(res.status).toBe(200);
 				expect(normalizeDrive(await res.text())).toMatchInlineSnapshot(`
 			"Error: Oops!
-			    at Object.throw (file:///D:/virtual/esm/base64.cjs:9:14)
+			    at Object.throw (file:///D:/virtual/node/base64.cjs:9:14)
 			    at Object.fetch (file:///D:/virtual/esm/index.mjs:17:22)"
 			`);
 			} else {
@@ -285,12 +285,12 @@ describe("LocalRuntimeController", () => {
 			    at Object.fetch (file:///virtual/esm/index.mjs:15:19)"
 			`);
 
-				// Check stack traces from NodeJsCompatModule modules include file path
-				res = await fetch(new URL("/throw-nodejs-compat-module", url));
+				// Check stack traces from CommonJS modules include file path
+				res = await fetch(new URL("/throw-other-commonjs", url));
 				expect(res.status).toBe(200);
 				expect(await res.text()).toMatchInlineSnapshot(`
 			"Error: Oops!
-			    at Object.throw (file:///virtual/esm/base64.cjs:9:14)
+			    at Object.throw (file:///virtual/node/base64.cjs:9:14)
 			    at Object.fetch (file:///virtual/esm/index.mjs:17:22)"
 			`);
 			}
diff --git a/packages/wrangler/src/config/environment.ts b/packages/wrangler/src/config/environment.ts
index 75fb8215a7..70719c6720 100644
--- a/packages/wrangler/src/config/environment.ts
+++ b/packages/wrangler/src/config/environment.ts
@@ -870,8 +870,7 @@ export type ConfigModuleRuleType =
 	| "Text"
 	| "Data"
 	| "PythonModule"
-	| "PythonRequirement"
-	| "NodeJsCompatModule";
+	| "PythonRequirement";
 
 export type TailConsumer = {
 	/** The name of the service tail events will be forwarded to. */
diff --git a/packages/wrangler/src/deployment-bundle/create-worker-upload-form.ts b/packages/wrangler/src/deployment-bundle/create-worker-upload-form.ts
index 8d5c99b524..dfb03926ac 100644
--- a/packages/wrangler/src/deployment-bundle/create-worker-upload-form.ts
+++ b/packages/wrangler/src/deployment-bundle/create-worker-upload-form.ts
@@ -27,7 +27,6 @@ export const moduleTypeMimeType: {
 	text: "text/plain",
 	python: "text/x-python",
 	"python-requirement": "text/x-python-requirement",
-	"nodejs-compat-module": undefined,
 };
 
 function toMimeType(type: CfModuleType): string {
diff --git a/packages/wrangler/src/deployment-bundle/module-collection.ts b/packages/wrangler/src/deployment-bundle/module-collection.ts
index 1b319db275..b7dc7090f5 100644
--- a/packages/wrangler/src/deployment-bundle/module-collection.ts
+++ b/packages/wrangler/src/deployment-bundle/module-collection.ts
@@ -36,7 +36,6 @@ export const RuleTypeToModuleType: Record<ConfigModuleRuleType, CfModuleType> =
 		Text: "text",
 		PythonModule: "python",
 		PythonRequirement: "python-requirement",
-		NodeJsCompatModule: "nodejs-compat-module",
 	};
 
 export const ModuleTypeToRuleType = flipObject(RuleTypeToModuleType);
diff --git a/packages/wrangler/src/deployment-bundle/worker.ts b/packages/wrangler/src/deployment-bundle/worker.ts
index 08a2ff8dd1..e659417757 100644
--- a/packages/wrangler/src/deployment-bundle/worker.ts
+++ b/packages/wrangler/src/deployment-bundle/worker.ts
@@ -22,8 +22,7 @@ export type CfModuleType =
 	| "text"
 	| "buffer"
 	| "python"
-	| "python-requirement"
-	| "nodejs-compat-module";
+	| "python-requirement";
 
 /**
  * An imported module.


Reviews:
user: login: CarmenPopoviciu
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T16:23:33Z
user: login: emily-shen
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T16:36:08Z
user: login: emily-shen
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T16:48:21Z
user: login: CarmenPopoviciu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-27T10:15:33Z
user: login: dario-piotrowicz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-27T10:34:04Z
user: login: CarmenPopoviciu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-27T10:46:20Z

Review comments:
diff_hunk: @@ -207,13 +207,13 @@ test("Miniflare: cannot automatically collect modules from dynamic import expres
 		modulesRoot: ROOT,
 		modulesRules: [
 			// Implicitly testing default module rules for `ESModule` and `CommonJS`
path: packages/miniflare/test/plugins/core/modules.spec.ts
user: login: emily-shen
body: ```suggestion
			// Implicitly testing default module rules for `ESModule`
```

created_at: 2025-03-26T16:36:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -207,13 +207,13 @@ test("Miniflare: cannot automatically collect modules from dynamic import expres
 		modulesRoot: ROOT,
 		modulesRules: [
 			// Implicitly testing default module rules for `ESModule` and `CommonJS`
path: packages/miniflare/test/plugins/core/modules.spec.ts
user: login: CarmenPopoviciu
body: thx for catching this
created_at: 2025-03-27T10:15:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -372,11 +372,8 @@ function buildProjectWorkerOptions(
 		runnerWorker.compatibilityFlags
 	);
 
-	if (mode !== "v1" && mode !== "v2") {
-		runnerWorker.compatibilityFlags.push(
-			"nodejs_compat",
-			"no_nodejs_compat_v2"
-		);
+	if (mode !== "v2") {
+		runnerWorker.compatibilityFlags.push("nodejs_compat_v2");
 	}
path: packages/vitest-pool-workers/src/pool/index.ts
user: login: dario-piotrowicz
body: Could someone clarify this logic here? why are we adding the flag if not present?

(PS: I'm not saying that I think it's wrong, I'd just really like to understand this bit 🙂)
created_at: 2025-03-27T10:34:04Z
author_association: MEMBER
diff_hunk: @@ -372,11 +372,8 @@ function buildProjectWorkerOptions(
 		runnerWorker.compatibilityFlags
 	);
 
-	if (mode !== "v1" && mode !== "v2") {
-		runnerWorker.compatibilityFlags.push(
-			"nodejs_compat",
-			"no_nodejs_compat_v2"
-		);
+	if (mode !== "v2") {
+		runnerWorker.compatibilityFlags.push("nodejs_compat_v2");
 	}
path: packages/vitest-pool-workers/src/pool/index.ts
user: login: CarmenPopoviciu
body: maybe @petebacondarwin ? This code path is very unfamiliar to me. Worth noting tho that this PR doesn't change the logic by which these flags are applied, so if the original code was doing something wrong I would rather fix that in a followup PR, rather than block this PR on it?
created_at: 2025-03-27T10:46:20Z
author_association: CONTRIBUTOR

PR comments:
user: login: changeset-bot[bot]
created_at: 2025-03-25T17:26:40Z
body: ###  🦋  Changeset detected

Latest commit: 825a3af4813fa7b671960b0badd9d5a35f3f5ada

**The changes in this PR will be included in the next version bump.**

<details><summary>This PR includes changesets to release 5 packages</summary>

  | Name                            | Type  |
| ------------------------------- | ----- |
| miniflare                       | Patch |
| @cloudflare/vitest-pool-workers | Patch |
| wrangler                        | Patch |
| @cloudflare/pages-shared        | Patch |
| @cloudflare/vite-plugin         | Patch |

</details>

Not sure what this means? [Click here  to learn what changesets are](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/cloudflare/workers-sdk/new/penalosa/remove-nodejs-compat-module?filename=.changeset/nine-lobsters-allow.md&value=---%0A%22miniflare%22%3A%20patch%0A%22%40cloudflare%2Fvitest-pool-workers%22%3A%20patch%0A%22wrangler%22%3A%20patch%0A---%0A%0ARemove%20%60NodeJSCompatModule%60%0A)


author_association: NONE
user: login: github-actions[bot]
created_at: 2025-03-25T18:45:37Z
body: A wrangler prerelease is available for testing. You can install this latest build in your project with:

```sh
npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-wrangler-8666
```

You can reference the automatically updated head of this PR with:

```sh
npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8666/npm-package-wrangler-8666
```

Or you can use `npx` with this latest build directly:

```sh
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-wrangler-8666 dev path/to/script.js
```

<details><summary>Additional artifacts:</summary>


cloudflare-workers-bindings-extension:
```sh
wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-cloudflare-workers-bindings-extension-8666 -O ./cloudflare-workers-bindings-extension.0.0.0-v67b16d5af.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v67b16d5af.vsix
```



create-cloudflare:
```sh
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-create-cloudflare-8666 --no-auto-update
```



@cloudflare/kv-asset-handler:
```sh
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-cloudflare-kv-asset-handler-8666
```



miniflare:
```sh
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-miniflare-8666
```



@cloudflare/pages-shared:
```sh
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-cloudflare-pages-shared-8666
```



@cloudflare/unenv-preset:
```sh
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-cloudflare-unenv-preset-8666
```



@cloudflare/vite-plugin:
```sh
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-cloudflare-vite-plugin-8666
```



@cloudflare/vitest-pool-workers:
```sh
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-cloudflare-vitest-pool-workers-8666
```



@cloudflare/workers-editor-shared:
```sh
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-cloudflare-workers-editor-shared-8666
```



@cloudflare/workers-shared:
```sh
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-cloudflare-workers-shared-8666
```



@cloudflare/workflows-shared:
```sh
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14104097440/npm-package-cloudflare-workflows-shared-8666
```


Note that these links will no longer work once [the GitHub Actions artifact expires](https://docs.github.com/en/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization).

</details>

---

`wrangler@4.5.0` includes the following runtime dependencies:

|Package|Constraint|Resolved|
|-------|----------|--------|
|`miniflare`|workspace:*|4.20250321.0|
|`workerd`|1.20250321.0|1.20250321.0|
|`workerd --version`|1.20250321.0|2025-03-21|

Please ensure constraints are pinned, and `miniflare`/`workerd` minor versions match.
<!-- Sticky Pull Request Comment -->
author_association: CONTRIBUTOR
user: login: CarmenPopoviciu
created_at: 2025-03-26T16:29:42Z
body: backport PR isn't created due to conflicts, so we'll need to create manually
author_association: CONTRIBUTOR