Skip to content

Commit

Permalink
This is a buffer here
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffreyBooth committed Jun 25, 2024
1 parent bcdb35e commit 2082b0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/modules/esm/get_format.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function getFileProtocolModuleFormat(url, context = { __proto__: null }, ignoreE
// `source` is undefined when this is called from `defaultResolve`;
// but this gets called again from `defaultLoad`/`defaultLoadSync`.
if (getOptionValue('--experimental-detect-module')) {
const format = detectModuleFormat(source, url);
const format = detectModuleFormat(source?.toString(), url);
if (format === 'module') {
// This module has a .js extension, a package.json with no `type` field, and ESM syntax.
// Warn about the missing `type` field so that the user can avoid the performance penalty of detection.
Expand Down

0 comments on commit 2082b0e

Please sign in to comment.