Skip to content

Commit bd80039

Browse files
Node.js: fixed ES modules format in loader.mjs.
Before Node.js v16.14.0 the "format" value in defaultResolve was ignored so error was hidden. For more information see: nodejs/node#40980
1 parent 3d53bba commit bd80039

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/changes.xml

+6
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ object, notably with Falcon.
100100
</para>
101101
</change>
102102

103+
<change type="bugfix">
104+
<para>
105+
ECMAScript modules did not work with the recent Node.js versions.
106+
</para>
107+
</change>
108+
103109
</changes>
104110

105111

src/nodejs/unit-http/loader.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ export async function resolve(specifier, context, defaultResolver) {
44
case "websocket":
55
return {
66
url: new URL("./websocket.js", import.meta.url).href,
7-
format: "cjs"
7+
format: "commonjs"
88
}
99

1010
case "http":
1111
return {
1212
url: new URL("./http.js", import.meta.url).href,
13-
format: "cjs"
13+
format: "commonjs"
1414
}
1515
}
1616

0 commit comments

Comments
 (0)