Skip to content

Commit 2082b0e

Browse files
committed
This is a buffer here
1 parent bcdb35e commit 2082b0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/modules/esm/get_format.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function getFileProtocolModuleFormat(url, context = { __proto__: null }, ignoreE
127127
// `source` is undefined when this is called from `defaultResolve`;
128128
// but this gets called again from `defaultLoad`/`defaultLoadSync`.
129129
if (getOptionValue('--experimental-detect-module')) {
130-
const format = detectModuleFormat(source, url);
130+
const format = detectModuleFormat(source?.toString(), url);
131131
if (format === 'module') {
132132
// This module has a .js extension, a package.json with no `type` field, and ESM syntax.
133133
// Warn about the missing `type` field so that the user can avoid the performance penalty of detection.

0 commit comments

Comments
 (0)