Skip to content

Commit 8abb43f

Browse files
authored
chore(wrangler): update unenv dependency version (#7614)
1 parent 6e6922e commit 8abb43f

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

.changeset/nice-pandas-wait.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
chore(wrangler): update unenv dependency version
6+
7+
The updated unenv contains a fix for the module resolution,
8+
see <https://github.com/unjs/unenv/pull/378>.
9+
That bug prevented us from using unenv module resolution,
10+
see <https://github.com/cloudflare/workers-sdk/pull/7583>.

packages/wrangler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"resolve": "^1.22.8",
8484
"selfsigned": "^2.0.1",
8585
"source-map": "^0.6.1",
86-
"unenv": "npm:[email protected]20241216-144314-7e05819",
86+
"unenv": "npm:[email protected]20241218-183400-5d6aec3",
8787
"workerd": "1.20241218.0",
8888
"xxhash-wasm": "^1.0.1"
8989
},
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { cloudflare, defineEnv } from "unenv";
2+
3+
describe("unenv", () => {
4+
test("module resolution does not throw", async () => {
5+
const env = {
6+
alias: {},
7+
...cloudflare,
8+
};
9+
10+
env.alias["should/no/throw"] = "if/this/is/not/valid";
11+
12+
// Throws "Error: ENOTDIR: not a directory, open '.../node_modules/.pnpm/[email protected]/node_modules/unenv-nightly/dist/index.mjs/package.json'"
13+
// before https://github.com/unjs/unenv/pull/378 is integrated via 2.0.0-20241218-183400-5d6aec3
14+
expect(() => {
15+
defineEnv({
16+
nodeCompat: true,
17+
presets: [env],
18+
resolve: true,
19+
});
20+
}).not.toThrow();
21+
});
22+
});

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)