Skip to content

Commit

Permalink
Merge pull request #5935 from NomicFoundation/better-esm-error-message
Browse files Browse the repository at this point in the history
Better ESM-only error message.
  • Loading branch information
alcuadrado authored Nov 7, 2024
2 parents ae4c8b1 + 3f10551 commit bacea43
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion v-next/hardhat/src/internal/cli/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,12 @@ async function printEsmErrorMessageIfNecessary(
if (packageJson.type !== "module") {
print(`Hardhat only supports ESM projects.
Please make sure you have \`"type": "module"\` in your package.json`);
Please make sure you have \`"type": "module"\` in your package.json.
You can set it automatically by running:
npm pkg set type="module"
`);

return true;
}
Expand Down

0 comments on commit bacea43

Please sign in to comment.