Skip to content

Commit 07f4010

Browse files
authored
fix unenv version mismatch (#9248)
1 parent a3b39d8 commit 07f4010

File tree

6 files changed

+18
-49
lines changed

6 files changed

+18
-49
lines changed

.changeset/four-books-heal.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@cloudflare/vite-plugin": patch
3+
"wrangler": patch
4+
---
5+
6+
fix unenv version mismatch

fixtures/nodejs-hybrid-app/src/index.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ export default {
3434
return await testTls();
3535
case "/test-crypto":
3636
return await testCrypto();
37-
case "/test-sqlite":
38-
return await testSqlite();
39-
case "/test-http":
40-
return await testHttp();
4137
}
4238

4339
return new Response(
@@ -49,8 +45,6 @@ export default {
4945
<a href="test-immediate">Test setImmediate</a>
5046
<a href="test-tls">node:tls</a>
5147
<a href="test-crypto">node:crypto</a>
52-
<a href="test-sqlite">node:sqlite</a>
53-
<a href="test-http">node:http</a>
5448
`,
5549
{ headers: { "Content-Type": "text/html; charset=utf-8" } }
5650
);
@@ -151,8 +145,6 @@ function testProcessBehavior() {
151145
assert.notEqual(process, undefined);
152146
assert.strictEqual(globalThis.process, process);
153147
assert.strictEqual(global.process, process);
154-
assert.strictEqual(typeof process.version, "string");
155-
assert.strictEqual(typeof process.versions.node, "string");
156148

157149
const fakeProcess1 = {} as typeof process;
158150
process = fakeProcess1;
@@ -249,20 +241,3 @@ async function testCrypto() {
249241

250242
return new Response("OK");
251243
}
252-
253-
async function testSqlite() {
254-
const sqlite = await import("node:sqlite");
255-
256-
assert.strictEqual(typeof sqlite.DatabaseSync, "function");
257-
258-
return new Response("OK");
259-
}
260-
261-
async function testHttp() {
262-
const http = await import("node:http");
263-
264-
const agent = new http.Agent();
265-
assert.strictEqual(typeof agent.options, "object");
266-
267-
return new Response("OK");
268-
}

fixtures/nodejs-hybrid-app/tests/index.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,4 @@ describe("nodejs compat", () => {
7676
const response = await fetch(`http://${ip}:${port}/test-crypto`);
7777
await expect(response.text()).resolves.toBe("OK");
7878
});
79-
80-
test("node:sqlite", async ({ expect }) => {
81-
const { ip, port } = wrangler;
82-
const response = await fetch(`http://${ip}:${port}/test-sqlite`);
83-
await expect(response.text()).resolves.toBe("OK");
84-
});
85-
86-
test("node:http", async ({ expect }) => {
87-
const { ip, port } = wrangler;
88-
const response = await fetch(`http://${ip}:${port}/test-http`);
89-
await expect(response.text()).resolves.toBe("OK");
90-
});
9179
});

packages/vite-plugin-cloudflare/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
"test:watch": "vitest"
4343
},
4444
"dependencies": {
45-
"@cloudflare/unenv-preset": "workspace:*",
45+
"@cloudflare/unenv-preset": "2.3.1",
4646
"@mjackson/node-fetch-server": "^0.6.1",
4747
"@rollup/plugin-replace": "^6.0.1",
4848
"get-port": "^7.1.0",
4949
"miniflare": "workspace:*",
5050
"picocolors": "^1.1.1",
5151
"tinyglobby": "^0.2.12",
52-
"unenv": "2.0.0-rc.17",
52+
"unenv": "2.0.0-rc.15",
5353
"wrangler": "workspace:*",
5454
"ws": "catalog:default"
5555
},

packages/wrangler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"esbuild": "catalog:default",
7575
"miniflare": "workspace:*",
7676
"path-to-regexp": "6.3.0",
77-
"unenv": "2.0.0-rc.17",
77+
"unenv": "2.0.0-rc.15",
7878
"workerd": "1.20250508.0"
7979
},
8080
"devDependencies": {

pnpm-lock.yaml

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)